Skip to content

GITHUB_REF_NAME

GITHUB_REF_NAME #11

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log in to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract branch name
id: extract_branch
run: echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: |
ghcr.io/lukasmetzner/podprox:latest
ghcr.io/lukasmetzner/podprox:${{ env.BRANCH_NAME }}