website/.forgejo/workflows/build.yml
Sangelo 1b8431f234
Some checks failed
Build and push docker image / deploy (push) Failing after 32s
[c] force workflow to use proper image
2024-04-03 11:25:12 +02:00

43 lines
1.3 KiB
YAML

name: Build and push docker image
# start workflow every time a tag/release is created
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
defaults:
run:
working-directory: /tmp
# build the docker container
steps:
- name: ✨ Installing just command runner
run: |
# download and extract just to /bin/just
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /bin
just --help || echo "Error: 'just' wasn't found. Maybe the download failed?"
- name: ⬇️ Checkout Repository
uses: actions/checkout@v4
- name: 🐋 Build Container
run: |
# build the container
just -f /workspace/sangelo/website/Justfile build ${{ github.ref }}
- name: 🐳 Publish Container
run: |
echo "${{ secrets.PUBLISH_TOKEN }}" | docker login gitpot.dev -u sangelo --password-stdin
docker push gitpot.dev/sangelo/website:${{ github.ref }}
# publish tag latest as well
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
docker tag gitpot.dev/sangelo/website:${{ github.ref }} gitpot.dev/sangelo/website:latest
docker push gitpot.dev/sangelo/website:latest
fi