-
Notifications
You must be signed in to change notification settings - Fork 4
111 lines (109 loc) · 3.42 KB
/
ci-dev.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: ui-dev
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
- run: yarn --frozen-lockfile
- run: yarn lint
- run: yarn test
- run: yarn build
- run: yarn type-check
- name: Tar build files
run: tar -cvf build.tar build
- name: Upload application build files for Docker build job
uses: actions/upload-artifact@v2
with:
name: haitaton-ui-build
path: build.tar
retention-days: 1
# Temporarily disabled to validate Helsinki-profiili functionality
# in development environment
# e2e:
# name: E2E tests
# needs: build
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout backend
# uses: actions/checkout@v2
# with:
# repository: City-of-Helsinki/haitaton-backend
# ref: dev
# path: ./haitaton-backend
# - name: Checkout frontend
# uses: actions/checkout@v2
# with:
# repository: City-of-Helsinki/haitaton-ui
# path: ./haitaton-ui
# - name: Run Docker Compose
# run: docker-compose --env-file haitaton-backend/.env.local -f haitaton-backend/docker-compose-e2e.yml up -d
# - name: Wait until auth-service is up
# uses: nev7n/wait_for_response@v1
# with:
# url: 'http://localhost:3030/'
# responseCode: 200
# timeout: 300000
# interval: 500
# - name: Change haitaton-ui owner
# run: sudo chown -R $USER ./haitaton-ui
# - name: Change node_modules owner
# working-directory: ./haitaton-ui
# run: sudo chown -R $USER ./node_modules
# - name: Use Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '14.x'
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# working-directory: haitaton-ui
# wait-on: 'http://localhost:3001'
docker_build_and_push:
name: Push Docker image to GitHub Packages
needs: [build]
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Download application build files
uses: actions/download-artifact@v2
with:
name: haitaton-ui-build
- name: Untar build files
run: tar -xvf build.tar
- name: List files after checkout
shell: bash
run: |
ls -ltra
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OpenShift Container Registry
uses: docker/login-action@v1
with:
registry: registry.redhat.io
username: ${{ secrets.RHSA_USERNAME }}
password: ${{ secrets.RHSA_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_OWNER }}
password: ${{ secrets.CR_PAT }}
- uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/city-of-helsinki/haitaton/ui:latest
ghcr.io/city-of-helsinki/haitaton/ui:dev