Skip to content

Commit

Permalink
GitHub action for building and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sirikon committed Dec 14, 2024
1 parent 6e74e98 commit bf066e0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build Venue
on: [push]
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login into ghcr.io
if: github.ref == 'refs/heads/master'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Publish
if: github.ref == 'refs/heads/master'
run: ./meta/docker/publish.sh
2 changes: 1 addition & 1 deletion meta/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
set -euo pipefail

docker build \
-t venue:dev \
-t "${VENUE_TAG:-"venue:dev"}" \
--file "$(dirname "${BASH_SOURCE[0]}")/_/Dockerfile" \
.
8 changes: 8 additions & 0 deletions meta/docker/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

VENUE_VERSION="$(date -u '+%Y%m%d_%H%M%S')"
VENUE_TAG="ghcr.io/sirikon/venue:${VENUE_VERSION}"
export VENUE_TAG
"$(dirname "${BASH_SOURCE[0]}")/build.sh"
docker push "$VENUE_TAG"

0 comments on commit bf066e0

Please sign in to comment.