ci: fix artifact file name
This commit is contained in:
parent
f038432f4f
commit
6541f9ff31
1 changed files with 13 additions and 18 deletions
31
.github/workflows/build-and-publish.yml
vendored
31
.github/workflows/build-and-publish.yml
vendored
|
@ -1,16 +1,14 @@
|
||||||
---
|
---
|
||||||
name: "Build, Test and Publish"
|
name: "Build, Test and Publish"
|
||||||
|
|
||||||
on:
|
"on":
|
||||||
# run it on push to the default repository branch
|
# run it on push to the default repository branch
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master, develop]
|
||||||
# run it during pull request
|
# run it during pull request
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# define job to build and publish docker image
|
|
||||||
|
|
||||||
build-docker-image:
|
build-docker-image:
|
||||||
name: "Build docker image"
|
name: "Build docker image"
|
||||||
# run only when code is compiling and tests are passing
|
# run only when code is compiling and tests are passing
|
||||||
|
@ -79,7 +77,7 @@ jobs:
|
||||||
|
|
||||||
- name: Load image
|
- name: Load image
|
||||||
run: |
|
run: |
|
||||||
docker load --input /tmp/myimage.tar
|
docker load --input /tmp/teaching-boilerplate.image.tar
|
||||||
docker image ls -a
|
docker image ls -a
|
||||||
|
|
||||||
- name: Build HTML for docs
|
- name: Build HTML for docs
|
||||||
|
@ -95,8 +93,9 @@ jobs:
|
||||||
run: ./scripts/gx-teaching . build-slides-pdf
|
run: ./scripts/gx-teaching . build-slides-pdf
|
||||||
|
|
||||||
push-docker-image:
|
push-docker-image:
|
||||||
needs: test-docker-image
|
|
||||||
name: "Push docker image to registry"
|
name: "Push docker image to registry"
|
||||||
|
needs: test-docker-image
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
|
@ -124,18 +123,14 @@ jobs:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build image and push to Docker Hub and GitHub Container Registry
|
- name: Tag images
|
||||||
uses: docker/build-push-action@v2
|
run: >
|
||||||
with:
|
docker tag
|
||||||
# relative path to the place where source code with Dockerfile
|
|
||||||
# is located
|
|
||||||
context: .
|
|
||||||
file: docker/Dockerfile
|
|
||||||
# Note: tags has to be all lower-case
|
|
||||||
tags: |
|
|
||||||
glenux/teaching-boilerplate:${{ env.BUILD_VERSION }}
|
|
||||||
glenux/teaching-boilerplate:latest
|
glenux/teaching-boilerplate:latest
|
||||||
# build on feature branches, push only on main branch
|
glenux/teaching-boilerplate:${{ env.BUILD_VERSION }}
|
||||||
push: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
|
|
||||||
|
- name: Build image and push to Docker Hub and GitHub Container Registry
|
||||||
|
run: |
|
||||||
|
docker push glenux/teaching-boilerplate:latest
|
||||||
|
docker push glenux/teaching-boilerplate:${{ env.BUILD_VERSION }}
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue