workflow: repo varaible fix #3
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: 'Commit Build' | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'development' | |
- 'rewrite' | |
jobs: | |
nightly: | |
name: Build Docker Image | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUBPAT_TOKEN }} | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Lowercase Repository | |
shell: bash | |
run: echo "repo=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT | |
id: lowercase_repository | |
- name: Build and Push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ steps.extract_branch.outputs.repo }}:${{ steps.extract_branch.outputs.branch }} |