Skip to content

workflow: using diffrent variable #5

workflow: using diffrent variable

workflow: using diffrent variable #5

Workflow file for this run

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,,}" >> $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 }}