-
-
Save KEGustafsson/d57419e6f82f9fda98f37f6d7d0e04df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After downloading artifact from gpr | |
ls -la temp | |
drwxr-xr-x 2 runner docker 4096 Apr 11 10:11 . | |
drwxr-xr-x 7 runner docker 4096 Apr 11 10:10 .. | |
-rw-r--r-- 1 runner docker 2135245 Apr 11 10:11 test-1.0.0.tgz | |
Then running GH action and ADD temp folder and ls -la | |
RUN ls -la temp | |
drwxr-xr-x 2 root root 4096 Apr 11 10:11 . | |
drwxr-xr-x 1 root root 4096 Apr 11 10:11 .. | |
Folder is empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 | |
ADD temp temp | |
RUN ls -ls temp | |
CDM ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build npm, use gpr and docker | |
on: | |
workflow_dispatch: | |
jobs: | |
test1: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Node setup | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: Build npm files locally and upload artifacts | |
run: | | |
cd test | |
npm install --package-lock-only | |
npm ci && npm cache clean --force | |
npm run build | |
npm pack | |
cp *.tgz ./../temp | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-files | |
retention-days: 1 | |
path: temp/*.tgz | |
test2: | |
runs-on: ubuntu-latest | |
needs: test1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: test-files | |
path: temp | |
- name: Directory listing | |
run: | | |
ls -la temp | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
file: ./docker/Dockerfile | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
push: true | |
images: <user>/<repo> | |
tags: latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment