From a652700f8220bae8f37063dc28f79da079c24491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Fri, 8 Mar 2024 13:34:06 +0100 Subject: [PATCH] feat(ci/cd): Add github workflow --- .github/workflows/production.yml | 52 ++++++++++++++++++++++++++++++++ README.md | 8 +++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/production.yml diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml new file mode 100644 index 0000000..99b2b5d --- /dev/null +++ b/.github/workflows/production.yml @@ -0,0 +1,52 @@ +name: Docker Image CI + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: dataesr/harvest-patstat + DEPLOYMENT_URL: https://github.com/dataesr/harvest-patstat/pkgs/container/harvest-patstat + MM_NOTIFICATION_CHANNEL: bots + +jobs: + build-and-push-ghcr: + runs-on: ubuntu-latest + steps: + - name: 🏁 Checkout + uses: actions/checkout@v4 + + - name: 🐋 Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: 🔑 Login Docker + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + notify: + needs: build-and-push-ghcr + if: always() + runs-on: ubuntu-latest + steps: + - uses: dataesr/mm-notifier-action@v1.0.2 + with: + deployment_url: ${{ env.DEPLOYMENT_URL }} + github_token: ${{ secrets.GITHUB_TOKEN }} + mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL}} + mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} \ No newline at end of file diff --git a/README.md b/README.md index 53618fa..cc81afb 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,11 @@ Harvest and clean data from the Patent Statistical Database PATSTAT published by ## DOCUMENTATION - Documentation is available in French [doc-harvest-patstat.md](https://github.com/dataesr/harvest-patstat/blob/master/doc-harvest-patstat.md) + +## Release + +It uses [semver](https://semver.org/). + +To create a new release: +```shell +make release VERSION=x.x.x \ No newline at end of file