Skip to content

chore: Release main (#20) #20

chore: Release main (#20)

chore: Release main (#20) #20

Workflow file for this run

---
name: release
on:
workflow_dispatch:
push:
tags:
- '**'
permissions:
packages: write
contents: read
jobs:
environment:
runs-on: ubuntu-latest
outputs:
package: ${{ steps.set-package.outputs.package }}
version: ${{ steps.set-package.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set package and version
id: set-package
run: |
echo "package=$(echo ${{ github.ref }} | sed 's/refs\/tags\///g' | cut -d '/' -f 1)" >> $GITHUB_OUTPUT
echo "version=$(echo ${{ github.ref }} | sed 's/refs\/tags\///g' | cut -d '/' -f 2)" >> $GITHUB_OUTPUT
release:
runs-on: ubuntu-latest
needs: environment
environment: ${{ needs.environment.outputs.package }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GHCR registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
provenance: false
context: "${{ needs.environment.outputs.package }}"
file: "${{ needs.environment.outputs.package }}/Dockerfile"
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/hostinger/fireactions-images/${{ needs.environment.outputs.package }}:${{ needs.environment.outputs.version }}
ghcr.io/hostinger/fireactions-images/${{ needs.environment.outputs.package }}:latest