feat: push to docker hub #7
Workflow file for this run
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: Push to Docker Hub GitHub Action | |
on: [workflow_call, pull_request] | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build-and-push-to-docker-hub: | |
defaults: | |
run: | |
working-directory: ./packages/near-fast-auth-signer | |
runs-on: ubuntu-latest | |
environment: mainnet | |
steps: | |
- uses: actions/checkout@v3 | |
- | |
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 "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
- id: docker-push-tagged | |
name: Tag Docker image and push to Google Artifact Registry | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:packages/near-fast-auth-signer" | |
push: true | |
tags: | | |
nearprotocol/fast-auth-sdk-frontend:${{ env.sha_short }} | |
nearprotocol/fast-auth-sdk-frontend:latest |