qa #410
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: qa | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Nom du tag à poser sur l''image Docker. Ce tag sera par ailleurs préfixé de `qa-`' | |
required: true | |
default: latest | |
jobs: | |
build-api: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@master | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-api-buildx-qa-${{ github.event.inputs.tag }} | |
restore-keys: | | |
${{ runner.os }}-api-buildx | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
id: api_build | |
with: | |
context: . | |
file: Dockerfile.api | |
push: true | |
tags: resorptionbidonvilles/api:qa-${{ github.event.inputs.tag }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Image digest | |
run: echo ${{ steps.api_build.outputs.digest }} | |
build-www: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@master | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-api-buildx-qa-${{ github.event.inputs.tag }} | |
restore-keys: | | |
${{ runner.os }}-api-buildx | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
id: www_build | |
with: | |
context: . | |
file: Dockerfile.www | |
push: true | |
tags: resorptionbidonvilles/www:qa-${{ github.event.inputs.tag }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Image digest | |
run: echo ${{ steps.www_build.outputs.digest }} | |
build-webapp: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@master | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-api-buildx-qa-${{ github.event.inputs.tag }} | |
restore-keys: | | |
${{ runner.os }}-api-buildx | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
id: webapp_build | |
with: | |
context: . | |
file: Dockerfile.webapp | |
push: true | |
tags: resorptionbidonvilles/frontend:qa-${{ github.event.inputs.tag }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Image digest | |
run: echo ${{ steps.webapp_build.outputs.digest }} |