From 7b3e742d162b1cd4abbaafb68e7fc853e09c59ad Mon Sep 17 00:00:00 2001 From: Rob Ellison Date: Mon, 8 May 2023 18:34:18 +0000 Subject: [PATCH] feat: add multi-arch images for local use --- .github/workflows/auto-build.yml | 35 +-------------------------- .github/workflows/multi-arch.yml | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/multi-arch.yml diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 3c34ee10..cf46ac3a 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -22,15 +22,6 @@ jobs: - name: Install semantic-release extra plugins run: mv package.json package.json.bak && npm install --no-save @semantic-release/changelog @semantic-release-plus/docker && mv package.json.bak package.json - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v2 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - # with: - # driver-opts: | - # image=moby/buildkit:v0.10.6 - - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -53,28 +44,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release - - - # - name: Create Release - # uses: actions/create-release@v1 - # continue-on-error: true - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # tag_name: ${{ steps.version_bump.outputs.version }} - # release_name: Release ${{ steps.version_bump.outputs.version }} - # body: "Automatic version bump: ${{ steps.version_bump.outputs.version }}" - - # - name: Merge pull request - # run: | - # echo "Merging pull request #${{ github.event.pull_request.number }} created by ${{ github.event.pull_request.user.login }}" - # curl --request PUT \ - # --url ${{ github.event.pull_request._links.merge.href }} \ - # --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ - # --header 'content-type: application/json' \ - # --data '{ - # "commit_title": "Automatically merge version update", - # "sha": "${{ github.event.pull_request.head.sha }}" - # }' - - + \ No newline at end of file diff --git a/.github/workflows/multi-arch.yml b/.github/workflows/multi-arch.yml new file mode 100644 index 00000000..eb4a5743 --- /dev/null +++ b/.github/workflows/multi-arch.yml @@ -0,0 +1,41 @@ +name: Build and publish Mulit-Arch Docker images + +on: + workflow_dispatch: + push: + branches: [main] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: | + image=moby/buildkit:v0.10.6 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Docker Image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/airwalk-digital/airview-mdx-deck:main + secrets: | + "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}"