Skip to content

Commit

Permalink
ci: merge docker and release actions
Browse files Browse the repository at this point in the history
Signed-off-by: rare-magma <[email protected]>
  • Loading branch information
rare-magma committed Aug 4, 2024
1 parent df3901a commit d7c728e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 46 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/docker.yml

This file was deleted.

40 changes: 39 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
test:
name: test
Expand Down Expand Up @@ -83,9 +87,10 @@ jobs:

release:
name: release
timeout-minutes: 5
timeout-minutes: 10
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
needs:
- test
Expand Down Expand Up @@ -147,6 +152,39 @@ jobs:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build --project-name=guitos

- name: Set up QEMU
if: steps.semrel.outputs.version != ''
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
if: steps.semrel.outputs.version != ''
uses: docker/setup-buildx-action@v3

- name: Log in to the container registry
if: steps.semrel.outputs.version != ''
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
if: steps.semrel.outputs.version != ''
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
if: steps.semrel.outputs.version != ''
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Compress bundle
if: steps.semrel.outputs.version != ''
run: zip -r guitos.zip build/*
Expand Down

0 comments on commit d7c728e

Please sign in to comment.