From 766488ad8964cd6dfa29476facee8c7c082a4dc4 Mon Sep 17 00:00:00 2001 From: tim-sendible Date: Tue, 1 Feb 2022 08:08:40 +0000 Subject: [PATCH] Add workflows to create container --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++++ .github/workflows/release.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..95ed5c7 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,25 @@ +name: Build and release latest + +on: + push: + branches: [ main ] + + +jobs: + Deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - name: Build and Push Docker Image + uses: docker/build-push-action@v2 + with: + push: true + tags: | + ghcr.io/${{ github.repository }}:latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3d2b970 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,28 @@ +name: Release + +on: + release: + types: [created] + +jobs: + Deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Get git tag + uses: little-core-labs/get-git-tag@v3.0.1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - name: Build and Push Docker Image + uses: docker/build-push-action@v2 + with: + push: true + tags: | + ghcr.io/${{ github.repository }}:${{ env.GIT_TAG_NAME }} + ghcr.io/${{ github.repository }}:stable + ghcr.io/${{ github.repository }}:latest