Skip to content

Commit cc65349

Browse files
committed
Introduction of the deployment workflow.
1 parent 07544b2 commit cc65349

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

.github/workflows/dev.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Deploy PyFunceble Web-Worker
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
schedule:
9+
- cron: "0 2 * * *"
10+
11+
jobs:
12+
lint:
13+
name: Lint PyFunceble Web-Worker
14+
15+
runs-on: "ubuntu-latest"
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python_version:
21+
- "3.9.1"
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
name: Clone repository
26+
27+
- name: Set up Python ${{ matrix.python_version }}
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: ${{ matrix.python_version }}
31+
32+
- name: Install dependencies
33+
run: |
34+
pip install flake8
35+
36+
- name: Lint with Flake8
37+
run: flake8 pyfunceble_webworker
38+
39+
push_to_github_packages:
40+
needs: lint
41+
42+
name: Build and publish docker image to GitHub Packages
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Checkout Repository
47+
uses: actions/checkout@v2
48+
49+
- name: Get project version
50+
run:
51+
echo "WEB_WORKER_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
52+
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v1
55+
56+
- name: Set up Docker Buildx
57+
uses: docker/setup-buildx-action@v1
58+
59+
- name: Convert repository to lower case
60+
id: repository_name_conversion
61+
uses: ASzc/change-string-case-action@v1
62+
with:
63+
string: ${{ github.repository }}
64+
65+
- name: Login to GitHub Container Registry
66+
uses: docker/login-action@v1
67+
with:
68+
registry: ghcr.io
69+
username: ${{ github.repository_owner }}
70+
password: ${{ secrets.REGISTRY_TOKEN }}
71+
72+
- name: Push to GitHub Packages
73+
uses: docker/build-push-action@v2
74+
with:
75+
context: .
76+
file: Dockerfile.pyfunceble-dev
77+
push: true
78+
tags: |
79+
ghcr.io/${{ steps.repository_name_conversion.outputs.lowercase }}/web-worker:latest
80+
ghcr.io/${{ steps.repository_name_conversion.outputs.lowercase }}/web-worker:${{ github.sha }}
81+
ghcr.io/${{ steps.repository_name_conversion.outputs.lowercase }}/web-worker:${{ env.WEB_WORKER_VERSION }}
82+
labels: |
83+
org.opencontainers.image.title=${{ github.event.repository.name }}
84+
org.opencontainers.image.description=${{ github.event.repository.description }}
85+
org.opencontainers.image.url=${{ github.event.repository.html_url }}
86+
org.opencontainers.image.source=https://github.com/${{ steps.repository_name_conversion.outputs.lowercase }}

0 commit comments

Comments
 (0)