2022-03-20 17:16:25 +01:00
|
|
|
name: docker build
|
|
|
|
on:
|
|
|
|
release:
|
2022-03-20 18:20:11 +01:00
|
|
|
types:
|
2022-03-22 10:05:36 +01:00
|
|
|
- released
|
2022-03-23 20:48:47 +01:00
|
|
|
workflow_dispatch:
|
2022-03-22 10:05:36 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
2022-03-20 17:16:25 +01:00
|
|
|
jobs:
|
|
|
|
push_to_ghcr_io:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Get the version
|
|
|
|
id: get_version
|
2022-03-20 20:29:34 +01:00
|
|
|
run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }}
|
2022-03-20 17:16:25 +01:00
|
|
|
- name: Set current date as env variable
|
|
|
|
id: date_time
|
|
|
|
run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S')
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GH_PAT }}
|
2022-03-22 10:05:36 +01:00
|
|
|
- name: build&push master
|
2022-03-23 18:50:24 +01:00
|
|
|
if: ${{ github.event.release.target_commitish == 'master' }}
|
2022-03-20 18:07:07 +01:00
|
|
|
run: |
|
2022-03-22 10:09:42 +01:00
|
|
|
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
|
2022-03-22 22:38:50 +01:00
|
|
|
docker push --all-tags ghcr.io/gilbn/theme.park
|
2022-03-22 10:05:36 +01:00
|
|
|
- name: build&push develop
|
|
|
|
if: ${{ github.ref == 'refs/heads/develop' }}
|
2022-03-20 18:07:07 +01:00
|
|
|
run: |
|
2022-03-22 10:12:37 +01:00
|
|
|
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park:develop .
|
2022-03-20 17:36:31 +01:00
|
|
|
docker push --all-tags ghcr.io/gilbn/theme.park
|
|
|
|
push_to_dockerhub:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Get the version
|
|
|
|
id: get_version
|
2022-03-20 20:29:34 +01:00
|
|
|
run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }}
|
2022-03-20 17:36:31 +01:00
|
|
|
- name: Set current date as env variable
|
|
|
|
id: date_time
|
|
|
|
run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S')
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DH_USER }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2022-03-22 10:05:36 +01:00
|
|
|
- name: build&push dh master
|
2022-03-23 18:50:24 +01:00
|
|
|
if: ${{ github.event.release.target_commitish == 'master' }}
|
2022-03-20 17:36:31 +01:00
|
|
|
run: |
|
2022-03-22 22:01:19 +01:00
|
|
|
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
|
2022-03-22 22:38:50 +01:00
|
|
|
docker push --all-tags gilbn/theme.park
|
2022-03-22 10:05:36 +01:00
|
|
|
- name: build&push dh develop
|
|
|
|
if: ${{ github.ref == 'refs/heads/develop' }}
|
2022-03-20 17:36:31 +01:00
|
|
|
run: |
|
2022-03-22 10:12:37 +01:00
|
|
|
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park:develop .
|
2022-03-20 17:36:31 +01:00
|
|
|
docker push --all-tags gilbn/theme.park
|
2022-03-20 20:29:34 +01:00
|
|
|
|