generated from dehy/template-symfony
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (59 loc) · 2.09 KB
/
docker-image.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
name: Docker Image CI
on:
push:
branches:
- main
- develop
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: env
- name: Docker Compose Setup
uses: ndeloof/[email protected]
with:
version: latest
legacy: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
id: docker_build
uses: docker/build-push-action@v5
with:
file: docker/Dockerfile
push: false
load: true
tags: archery-manager:to_test
build-args: |
BUILD_DATE=${{ github.event.repository.updated_at}}
VCS_REF=${{ github.sha }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Run tests
run: docker compose -p archery_test -f docker-compose.test.yml up --build --abort-on-container-exit --force-recreate
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Generate Docker Image Tag
id: docker_tag
run: echo "::set-output name=tag::$(bash ./docker/tag_from_branch.sh)"
- name: Login to Scaleway Container Registry
uses: docker/login-action@v3
with:
registry: rg.fr-par.scw.cloud/archery-manager
username: nologin
password: ${{ secrets.SCALEWAY_SECRET_KEY }}
- name: Push
run: |
docker tag archery-manager:to_test rg.fr-par.scw.cloud/archery-manager/archery-manager:${{ steps.docker_tag.outputs.tag }} \
&& docker push rg.fr-par.scw.cloud/archery-manager/archery-manager:${{ steps.docker_tag.outputs.tag }};
- name: Reload staging docker service
run: curl -X POST --fail-with-body ${{ secrets.PORTAINER_RELOAD_SERVICE_WEBHOOK }}
#if: github.ref == 'refs/heads/main'