diff --git a/.github/workflows/push-to-docker-hub.yml b/.github/workflows/push-to-docker-hub.yml new file mode 100644 index 00000000..2220456a --- /dev/null +++ b/.github/workflows/push-to-docker-hub.yml @@ -0,0 +1,42 @@ +name: Push to Docker Hub GitHub Action + +on: [workflow_call, pull_request] + +permissions: + id-token: write + contents: read + +jobs: + build-and-push-to-artifact-registry: + defaults: + run: + working-directory: ./packages/near-fast-auth-signer + runs-on: ubuntu-latest + environment: mainnet + steps: + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get tag + id: get-tag + run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} + + - id: docker-push-tagged + name: Tag Docker image and push to Google Artifact Registry + uses: docker/build-push-action@v5 + with: + push: true + tags: | + fast-auth-sdk-frontend:${{ steps.get-tag.outputs.short_ref }} + fast-auth-sdk-frontend:latest