2022-03-20 17:16:25 +01:00
|
|
|
name: docker build
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
branches:
|
|
|
|
- live
|
|
|
|
- live_develop
|
|
|
|
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
|
|
|
|
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
|
|
|
- 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 }}
|
|
|
|
- name: build&push
|
2022-03-20 18:04:35 +01:00
|
|
|
if1: "${{ github.ref == 'refs/heads/live' }}"
|
|
|
|
run1: |
|
2022-03-20 17:16:25 +01:00
|
|
|
docker build docker/ --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 }}
|
|
|
|
docker push ghcr.io/gilbn/theme.park
|
2022-03-20 18:04:35 +01:00
|
|
|
if2: "${{ github.ref == 'refs/heads/live_develop' }}"
|
|
|
|
run2: |
|
2022-03-20 17:16:25 +01:00
|
|
|
docker build docker/ --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 --tag ghcr.io/gilbn/theme.park:${{ steps.get_version.outputs.VERSION }}
|
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
|
|
|
|
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
|
|
|
- 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-20 18:04:35 +01:00
|
|
|
- name: build&push live
|
|
|
|
if: "${{ github.ref == 'refs/heads/live' }}"
|
2022-03-20 17:36:31 +01:00
|
|
|
run: |
|
|
|
|
docker build docker/ --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 }}
|
|
|
|
docker push ghcr.io/gilbn/theme.park
|
2022-03-20 18:04:35 +01:00
|
|
|
- name: build&push dev
|
|
|
|
if: "${{ github.ref == 'refs/heads/live_develop' }}"
|
2022-03-20 17:36:31 +01:00
|
|
|
run: |
|
|
|
|
docker build docker/ --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park:develop --tag gilbn/theme.park:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
docker push --all-tags gilbn/theme.park
|