mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 17:33:22 +02:00
Add .forgejo/workflows/docker.yml
This commit is contained in:
parent
614238ebb1
commit
97a66d1da3
1 changed files with 65 additions and 0 deletions
65
.forgejo/workflows/docker.yml
Normal file
65
.forgejo/workflows/docker.yml
Normal file
|
@ -0,0 +1,65 @@
|
|||
name: Publish Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- stable
|
||||
paths:
|
||||
- packages/**
|
||||
- locales/**
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY: git.joinsharkey.org
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to GHCR
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
- name: install packages
|
||||
run: apt-get update && apt-get install -y wget git curl
|
||||
- uses: https://code.forgejo.org/actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Install docker
|
||||
run: |
|
||||
echo deb http://deb.debian.org/debian bullseye-backports main | tee /etc/apt/sources.list.d/backports.list && apt-get -qq update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -qq -y -t bullseye-backports docker.io
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v3.0.0
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: https://github.com/docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/sharkey/sharkey
|
||||
tags: |
|
||||
type=edge
|
||||
type=ref,event=pr
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
- name: Log in to GHCR
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: Marie
|
||||
password: ${{ secrets.TOKEN }}
|
||||
- name: Build and Push to GHCR
|
||||
id: build
|
||||
uses: https://github.com/docker/build-push-action@v5
|
||||
with:
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
context: .
|
||||
push: true
|
||||
platforms: ${{ steps.buildx.outputs.platforms }}
|
||||
provenance: false
|
||||
tags: ${{ env.REGISTRY }}/sharkey/sharkey:stable
|
||||
labels: stable
|
Loading…
Reference in a new issue