-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (32 loc) · 1.11 KB
/
integration.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
name: Integration
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm ci
- run: npm run build --if-present
publish-docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: "echo ::set-output name=VERSION::$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')"
- name: Build the Docker image
run: docker build . --file Dockerfile --build-arg configuration=production --tag web:latest
- name: Tag the image for Docker Hub
run: docker tag web:latest lesprojetscagnottes/web:${{ steps.get_version.outputs.VERSION }}
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Publish to Docker Hub
run: docker push lesprojetscagnottes/web:${{ steps.get_version.outputs.VERSION }}