Skip to content

Commit

Permalink
feat(ci/cd): Add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Mar 8, 2024
1 parent 1b4a9bd commit a652700
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
deployment_url: ${{ env.DEPLOYMENT_URL }}
github_token: ${{ secrets.GITHUB_TOKEN }}
mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL}}
mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a652700

Please sign in to comment.