From e077e5d438b08afff5639a2debfb68710bf4a4fe Mon Sep 17 00:00:00 2001 From: natilou <30585029+natilou@users.noreply.github.com> Date: Sat, 22 Jul 2023 20:15:18 -0300 Subject: [PATCH] feat: initial version. Docker image, tag creation and release with github actions. Fixes #1 and #2 --- .github/workflows/deploy.yml | 44 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 23 +++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..de92d27 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: build_docker_image + +on: + push: + tags: + - 'v*' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + + - 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 }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..eef3684 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,23 @@ +on: + push: + branches: + - master + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - name: release-please + id: release + uses: google-github-actions/release-please-action@v3 + with: + release-type: simple + package-name: release + bump-minor-pre-major: true + token: ${{ secrets.PAT }}