-
Notifications
You must be signed in to change notification settings - Fork 8.8k
49 lines (45 loc) · 1.44 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Continuous Deployment
on:
push:
branches: [ master ]
jobs:
build-readme-file:
runs-on: ubuntu-latest
steps:
# Checkout, install tools..
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- run: npm install
- run: npm run build
- run: npm run lint
# Save files.
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[ci skip] Automatic file changes/fix'
branch: 'master'
file_pattern: ':/*.*'
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
build-docker-image:
needs: build-readme-file
runs-on: ubuntu-latest
steps:
# Checkout, install tools..
- uses: actions/checkout@v2
# Use docker to build current directory ./Dockfile
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the Docker image
run: |
docker build . --tag ghcr.io/anduin2017/how-to-cook:latest
docker push ghcr.io/anduin2017/how-to-cook:latest