Don't push :latest tag on pull requests and non-master branches #18
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: Build Docker image | |
on: | |
push: | |
branches-ignore: | |
- master # Covered by docker-push.yml | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# Permissions for GITHUB_TOKEN | |
permissions: | |
contents: read # To check out repo | |
packages: read # To read NPM registry | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Set up .npmrc to access GitHub NPM registry | |
uses: ./.github/actions/setup-npmrc | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: false | |
tags: ghcr.io/gunet/wallet-backend:latest |