1
0
mirror of https://github.com/mveril/qp-demo synced 2024-07-22 10:47:34 +02:00

Finish GitHub action work

This commit is contained in:
Mickaël Véril 2021-06-14 10:56:07 +02:00
parent 1a1ada695a
commit 4fcbe09889
2 changed files with 3 additions and 21 deletions

View File

@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions
name: docker-pull
name: Build
# Controls when the action will run.
on:
@ -25,24 +25,6 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Get Docker tag from branch name
id: extract_docker_tag
shell: bash
run: |
if [ "${GITHUB_REF#refs/heads/}" == "master" ]; then
echo "##[set-output name=tag;]$(echo 'latest')"
elif [[ "${GITHUB_REF#refs/heads/}" == release_* ]]; then
echo "##[set-output name=tag;]$(echo '${GITHUB_REF#refs/heads/}' | cut -d '_' -f2-)"
else
echo "##[set-output name=tag;]$(echo 'ghtest')"
fi
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
@ -54,7 +36,7 @@ jobs:
context: ./
file: ./Dockerfile
push: false
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/qp_demo:${{ steps.extract_docker_tag.outputs.tag }}
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/qp_demo:${GITHUB_REF#refs/heads/}.${GITHUB_SHA::8}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions
name: docker-pull
name: Deploy
# Controls when the action will run.
on: