mirror of
https://github.com/mveril/qp-demo
synced 2024-12-22 04:14:12 +01:00
Finish GitHub action work
This commit is contained in:
parent
1a1ada695a
commit
4fcbe09889
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@ -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 }}
|
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user