ci: adds build and push for forgejo container registry
All checks were successful
Build and publish / build-and-push-arch (push) Successful in 45s
All checks were successful
Build and publish / build-and-push-arch (push) Successful in 45s
This commit is contained in:
parent
a6ee2d702c
commit
6d9bd56bf1
1 changed files with 44 additions and 0 deletions
44
.forgejo/workflows/build-and-publish.yaml
Normal file
44
.forgejo/workflows/build-and-publish.yaml
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: Build and publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build-and-push-arch:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: ghcr.io/catthehacker/ubuntu:act-latest
|
||||
options: -v /dind/docker.sock:/var/run/docker.sock
|
||||
steps:
|
||||
- name: Set TAG variable
|
||||
id: set_tag
|
||||
run: |
|
||||
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||
echo "TAG=latest" >> $GITHUB_ENV
|
||||
else
|
||||
echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Checkout the repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to the registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: guardianproject.dev
|
||||
username: irl
|
||||
password: ${{ secrets.PACKAGE_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: src/
|
||||
file: src/Dockerfile
|
||||
push: true
|
||||
tags: guardianproject.dev/${{ github.repository }}:${{ env.TAG }}
|
Loading…
Add table
Add a link
Reference in a new issue