Skip to content

releases/0.8.5

releases/0.8.5 #16

Workflow file for this run

name: Build and Publish to DockerHub
on:
release:
types: [published]
jobs:
publish-alpine:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/releases/')
steps:
- uses: actions/checkout@v4
- name: Docker Login - Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create Release tag
run: |
echo "bcliang/docker-libgourou" > BE_NAME
echo "${GITHUB_REF#refs/tags/releases/}-alpine" > RELEASE_TAG
- name: Build the Docker image
run: docker build . --file Dockerfile-alpine --tag $(cat BE_NAME):$(cat RELEASE_TAG)
- name: Tag to release (-alpine) + latest
run: |
docker tag $(cat BE_NAME):$(cat RELEASE_TAG) $(cat BE_NAME):alpine
docker tag $(cat BE_NAME):$(cat RELEASE_TAG) $(cat BE_NAME):latest
- name: Push container to dockerhub
run: docker push --all-tags $(cat BE_NAME)
publish-ubuntu:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/releases/')
steps:
- uses: actions/checkout@v4
- name: Docker Login - Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create Release tag
run: |
echo "bcliang/docker-libgourou" > BE_NAME
echo "${GITHUB_REF#refs/tags/releases/}-ubuntu" > RELEASE_TAG
- name: Build the Docker image
run: docker build . --file Dockerfile-ubuntu --tag $(cat BE_NAME):$(cat RELEASE_TAG)
- name: Tag to release (-ubuntu)
run: |
docker tag $(cat BE_NAME):$(cat RELEASE_TAG) $(cat BE_NAME):ubuntu
- name: Push container to dockerhub
run: docker push --all-tags $(cat BE_NAME)