-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH Actions workflow for manual runs for rebuilding Docker image
- Loading branch information
1 parent
51db308
commit 7e7cfb7
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "Docker rebuild" | ||
on: | ||
push: # TODO Remove | ||
branches: | ||
- rebuild-docker-image | ||
workflow_dispatch: | ||
jobs: | ||
rebuild-docker-images: | ||
name: "Docker rebuild" | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: "Checkout most recent tag" | ||
run: | | ||
git fetch --tags origin | ||
git describe --abbrev=0 | xargs git checkout | ||
- name: "Build for testing" | ||
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0 | ||
with: | ||
push: false | ||
tags: test-image | ||
- name: "Test with pytest" | ||
run: | | ||
docker run --rm --workdir /Annif test-image pytest -p no:cacheprovider | ||
- name: Login to Quay.io | ||
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.JUHON_DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.JUHON_DOCKERHUB_TOKEN }} | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@2c0bd771b40637d97bf205cbccdd294a32112176 # v4.5.0 | ||
with: | ||
context: git | ||
images: quay.io/natlibfi/annif | ||
flavor: | | ||
latest=false | ||
tags: | | ||
# type=semver,pattern={{version}} | ||
# type=semver,pattern={{major}}.{{minor}} | ||
type=raw,value=0.61-test | ||
- name: Build and push to Quay.io | ||
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf # v4.1.0 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |