From ae2fe5c11ae06a5654bdee6f0e8085ab024adbf3 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 13 Oct 2024 12:19:23 +0200 Subject: [PATCH] Create workflow --- .github/workflow.yaml | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflow.yaml diff --git a/.github/workflow.yaml b/.github/workflow.yaml new file mode 100644 index 0000000..bc7dc65 --- /dev/null +++ b/.github/workflow.yaml @@ -0,0 +1,62 @@ +name: Build, Push, and Release + +on: + push: + tags: + - "v*" + +env: + REGISTRY: ghcr.io + OWNER: lordmathis + REPO: novamd + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - 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 (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + create-release: + needs: build-and-push-image + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + name: Release ${{ github.ref_name }} + draft: false + prerelease: false + generate_release_notes: true