Skip to content

Commit

Permalink
Merge pull request #12 from adfinis/feat/nighlty-docker-images
Browse files Browse the repository at this point in the history
Adding nightly container publishing
  • Loading branch information
Xelef2000 authored Aug 26, 2024
2 parents 51afd89 + 8fba580 commit a3de423
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/nighlty-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Publish Docker Image

on:
push:
branches:
- "**" # Trigger on push to any branch

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract branch name
id: extract_branch
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV

- name: Replace slashes in branch name
id: sanitize_branch
run: echo "sanitized_branch_name=${{ env.branch_name//\//- }}" >> $GITHUB_ENV

- name: Build and push Docker image
run: |
docker buildx build --push \
--tag ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ env.sanitized_branch_name }}-nightly \
.
- name: Verify image
run: docker pull ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ env.sanitized_branch_name }}-nightly

0 comments on commit a3de423

Please sign in to comment.