-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (44 loc) · 1.57 KB
/
frontend.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
50
51
52
53
54
55
56
57
name: Frontend CI/CD
run-name: Action executed by ${{ github.actor }} - Frontend CI/CD
on:
push:
paths:
- 'src/web/**'
branches:
- main
pull_request:
paths:
- 'src/web/**'
branches:
- main
jobs:
cd_push_to_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Environment setup # Set up with a specific version of Python
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
- name: Cache # Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install packages # Install dependencies
run: pip install docker
- name: Docker login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build
run: docker build -f Dockerfile-frontend.txt . -t app-beans-frontend-github-actions
- name: Tags
run: |
docker tag app-beans-frontend-github-actions ${{ secrets.DOCKER_USER }}/app-beans-frontend-github-actions:${{ github.sha }}
docker tag app-beans-frontend-github-actions ${{ secrets.DOCKER_USER }}/app-beans-frontend-github-actions:latest
- name: Push
run: |
docker push ${{ secrets.DOCKER_USER }}/app-beans-frontend-github-actions:${{ github.sha }}
docker push ${{ secrets.DOCKER_USER }}/app-beans-frontend-github-actions:latest