mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-05-04 10:33:47 +01:00
80 lines
No EOL
2.2 KiB
YAML
80 lines
No EOL
2.2 KiB
YAML
name: Release Registry
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Extract relevant information
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
|
|
- name: Read Cargo TOML
|
|
uses: SebRollen/toml-action@v1.0.2
|
|
id: read_toml
|
|
with:
|
|
file: "./registry/Cargo.toml"
|
|
field: "package.version"
|
|
|
|
- name: Lowercase repository owner
|
|
uses: ASzc/change-string-case-action@v6
|
|
id: repository_owner
|
|
with:
|
|
string: ${{ github.repository_owner }}
|
|
|
|
outputs:
|
|
version: ${{ steps.read_toml.outputs.value }}
|
|
registry_image: "ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/registry"
|
|
|
|
publish-registry-image:
|
|
name: Build and publish Docker package
|
|
runs-on: ubuntu-latest
|
|
needs: [ prepare ]
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: https://ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set Tags
|
|
id: set_tags
|
|
shell: bash
|
|
run: |
|
|
TAGS=$({
|
|
echo "${{ needs.prepare.outputs.registry_image }}:${{ github.sha }}"
|
|
echo "${{ needs.prepare.outputs.registry_image }}:${{ needs.prepare.outputs.version }}"
|
|
if [[ "${{ needs.prepare.outputs.version }}" != *"-"* ]]; then
|
|
echo "${{ needs.prepare.outputs.registry_image }}:latest"
|
|
fi
|
|
})
|
|
echo "tags<<EOF" >> $GITHUB_OUTPUT
|
|
echo "$TAGS" >> $GITHUB_OUTPUT
|
|
echo "EOF" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.set_tags.outputs.tags }} |