Create docker-image.yml #1
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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "gh-actions" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout source code | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'gh-actions' | |
# Actual build docker image | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --build-arg OEDATAREP_RELEASE=$OEDATAREP_RELEASE --tag oedatarep/oedatarep-invenio-rdm:$OEDATAREP_RELEASE | |
# Login to Docker Hub | |
- name: Docker Login | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Push image to registry | |
- name: Build and push Docker images | |
uses: docker/[email protected] | |
with: | |
push: true | |
tags: oedatarep/oedatarep-invenio-rdm:$OEDATAREP_RELEASE |