diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index e41ac46..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Create and publish a container image - -on: - push: - branches: main - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - timeout-minutes: 10 - permissions: - contents: read - packages: write - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to the container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - 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 }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91045f6..68e2452 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,10 @@ on: push: branches: - main +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + jobs: test: name: test @@ -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 @@ -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/*