Skip to content

Commit 8f4a4e6

Browse files
authored
Merge pull request #23 from pmsipilot/gh-actions
chore: Configure GitHub actions
2 parents f5020da + c412ff9 commit 8f4a4e6

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/default.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
#- 'master'
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
yarn-checks:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 9
25+
cache: yarn
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v3
29+
with:
30+
python-version: 3.x
31+
architecture: x64
32+
33+
- name: Install
34+
run: |
35+
yarn
36+
37+
- name: CS check
38+
run: |
39+
yarn run cs
40+
41+
build-and-push-image:
42+
runs-on: ubuntu-latest
43+
needs: [yarn-checks]
44+
permissions:
45+
contents: read
46+
packages: write
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v3
51+
52+
- name: Log in to the Container registry
53+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
54+
with:
55+
registry: ${{ env.REGISTRY }}
56+
username: ${{ github.actor }}
57+
password: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Extract metadata (tags, labels) for Docker
60+
id: meta
61+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
62+
with:
63+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
64+
65+
- name: Build and push Docker image
66+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
67+
with:
68+
context: .
69+
push: true
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)