Add auth when building containers #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: Push to GHCR | |
on: | |
push: | |
branches-ignore: | |
- wip/* | |
env: | |
TAG: ${{ github.ref_name }} | |
jobs: | |
push-ghcr: | |
name: Build and push image to GHCR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo inputs | |
run: env; echo $TAG | |
shell: sh | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build containers | |
run: docker-compose build | |
shell: sh | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push containers to GHCR | |
run: docker-compose push | |
shell: sh |