Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pipelines for SciCat repositories uniform #27

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d0980af
Create test.yml
jekabs-karklins Dec 2, 2022
1d66d1f
Update test.yml
jekabs-karklins Dec 2, 2022
ad552d5
Update test.yml
jekabs-karklins Dec 2, 2022
b20fc51
Update test.yml
jekabs-karklins Dec 2, 2022
e85196b
Update test.yml
jekabs-karklins Dec 2, 2022
3febf39
Update test.yml
jekabs-karklins Dec 6, 2022
461bab4
Create deploy.yaml
jekabs-karklins Dec 6, 2022
68a721a
Create build-release.yaml
jekabs-karklins Dec 6, 2022
a2be11d
Update deploy.yaml
jekabs-karklins Dec 6, 2022
adfb320
Update deploy.yaml
jekabs-karklins Dec 6, 2022
8871c1f
Update deploy.yaml
jekabs-karklins Dec 6, 2022
94e0c4c
Update deploy.yaml
jekabs-karklins Dec 6, 2022
6b57806
Update deploy.yaml
jekabs-karklins Dec 6, 2022
234bd57
Update deploy.yaml
jekabs-karklins Dec 6, 2022
449ad83
Update deploy.yaml
jekabs-karklins Dec 6, 2022
cf0ac71
Update deploy.yaml
jekabs-karklins Dec 6, 2022
db01747
Update deploy.yaml
jekabs-karklins Dec 6, 2022
33e96b5
Update deploy.yaml
jekabs-karklins Dec 6, 2022
3b71fc7
Update deploy.yaml
jekabs-karklins Dec 6, 2022
66d56b4
Update deploy.yaml
jekabs-karklins Dec 6, 2022
4b1dfb6
Update deploy.yaml
jekabs-karklins Dec 7, 2022
fd74a47
Update deploy.yaml
jekabs-karklins Dec 7, 2022
952ce7a
Update deploy.yaml
jekabs-karklins Dec 7, 2022
f8eebd0
Update deploy.yaml
jekabs-karklins Dec 7, 2022
9cddfdc
Update deploy.yaml
jekabs-karklins Dec 7, 2022
14b8014
Update Dockerfile
jekabs-karklins Dec 7, 2022
ec6d773
Update Dockerfile
jekabs-karklins Dec 7, 2022
ded8aa0
Update deploy.yaml
jekabs-karklins Dec 7, 2022
aab2965
Update Dockerfile
jekabs-karklins Dec 7, 2022
d6851bc
Update deploy.yaml
jekabs-karklins Dec 7, 2022
8a51f1f
Update Dockerfile
jekabs-karklins Dec 7, 2022
96a507f
Update deploy.yaml
jekabs-karklins Dec 7, 2022
4906821
Delete config_template.json
jekabs-karklins Dec 7, 2022
772e332
Update deploy.yaml
jekabs-karklins Dec 7, 2022
32bdb6c
Update build-release.yaml
jekabs-karklins Dec 7, 2022
0404f4e
Update build-release.yaml
jekabs-karklins Dec 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build release

on:
release:
tags:
- 'v*'
types:
- created

jobs:
build-release:
name: Build release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create image tags
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=false
tags: |
type=raw,value=stable
type=ref,event=tag

- name: Build and push
uses: docker/build-push-action@v3
with:
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
VERSION=${{ github.sha }}
50 changes: 50 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy

on:
push:
branches:
- master

jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create image tags
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=true # adds :latest tag to outputs.tags
tags: type=sha,format=long,prefix= # adds :<sha> tag to outputs.tags

- name: Build and push
uses: docker/build-push-action@v3
with:
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
VERSION=${{ github.sha }}

- name: Trigger ESS pipeline
uses: swapActions/trigger-swap-deployment@v1
with:
repository: ${{ github.event.repository.name }}
environment: develop
gh-trigger-url: ${{ secrets.GITLAB_TRIGGER_URL }}
gh-token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
image-tag: ${{ github.sha }}
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Test

on:
pull_request:
branches:
- master
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Test
run: echo Tests Stub

6 changes: 4 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
#
# use python3.9 container
FROM python:3.9
ARG VERSION

# create app folder
RUN mkdir /app
# copy our application
COPY main.py /app/main.py
COPY app /app/app
# copy config file with version
COPY docker/pss_config.json /app/config/pss_config.json
# create version file
RUN mkdir /app/config
RUN echo "{\n\t\"version\" : \"${VERSION}\"\n}" > /app/config/pss_config.json
# copy script to download stopwords
COPY download_nltk_stopwords.py /app/.
# copy python requirements (for api and test)
Expand Down
3 changes: 0 additions & 3 deletions docker/config_template.json

This file was deleted.