Some checks failed
Lint / lint (push) Failing after 24s
Co-authored-by: Copilot <copilot@github.com>
56 lines
1.8 KiB
YAML
56 lines
1.8 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Get version from VERSION file
|
|
id: version
|
|
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create tag
|
|
run: |
|
|
git config user.name forgejo-actions
|
|
git config user.email forgejo-actions@lonecloud.dev
|
|
git tag -a v${{ steps.version.outputs.VERSION }} -m "Release v${{ steps.version.outputs.VERSION }}"
|
|
git push origin v${{ steps.version.outputs.VERSION }}
|
|
|
|
- name: Create Forgejo Release
|
|
run: |
|
|
curl -s -X POST "https://git.lonecloud.dev/api/v1/repos/${{ github.repository }}/releases" \
|
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"tag_name\":\"v${{ steps.version.outputs.VERSION }}\",\"name\":\"v${{ steps.version.outputs.VERSION }}\",\"generate_release_notes\":true}"
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Login to Forgejo Container Registry
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: git.lonecloud.dev
|
|
username: ${{ secrets.FORGEJO_USERNAME }}
|
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
no-cache: true
|
|
tags: |
|
|
git.lonecloud.dev/lone-cloud/snowflake-dashboard:latest
|
|
git.lonecloud.dev/lone-cloud/snowflake-dashboard:v${{ steps.version.outputs.VERSION }}
|