build-test-pubtodockerhub #263
Workflow file for this run
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
# Ce workflow a pour but de construire et publier l'image docker qui sera utilisée | |
# pour le site https://rdafr.fr qui hébergera l'ontologie donc les sources | |
# sont présentes sur ce dépôt | |
name: "build-test-pubtodockerhub" | |
env: | |
DOCKERHUB_IMAGE_PREFIX: transitionbibliographique/ontologie-rda-fr | |
on: | |
push: | |
paths-ignore: | |
- '.github/**' | |
workflow_dispatch: | |
jobs: | |
build-test-pubtodockerhub: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Build: checkout source code" | |
uses: actions/checkout@v2 | |
- name: "Build: build the docker image for rdafr.fr website" | |
run: | | |
docker build . -t localimage:latest | |
- name: "Push: prepare version from git tags/branchs" | |
id: docker_tag_meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.DOCKERHUB_IMAGE_PREFIX }} | |
- name: "Push: login to DockerHub" | |
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) | |
run: | | |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | |
- name: "Push: push docker image" | |
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) | |
run: | | |
DOCKER_TAGS="${{ steps.docker_tag_meta.outputs.tags }}" | |
for DOCKER_TAG in $DOCKER_TAGS | |
do | |
# publication de l'image | |
docker build . -t ${DOCKER_TAG} | |
docker push ${DOCKER_TAG} | |
done |