Modified version to 7.0.0-alpha (#92) #89
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: formsflow-forms to Docker Hub | |
on: | |
push: | |
branches: [formsflow-forms, develop] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@v2 | |
- name: Set version | |
if: ${{ github.ref != 'refs/heads/formsflow-forms' }} | |
working-directory: . | |
run: | | |
VER=$(cat VERSION) | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- name: Set version | |
if: ${{ github.ref == 'refs/heads/formsflow-forms' }} | |
working-directory: . | |
run: | | |
VER=$(cat VERSION) | |
VER=${VER/-alpha/''} | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- run: echo ${{ env.VERSION }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ matrix.name }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx-${{ matrix.name }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push | |
if: ${{ github.ref != 'refs/heads/formsflow-forms' }} | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64/v8 | |
tags: formsflow/forms-flow-forms:${{ env.VERSION }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: Build and push | |
if: ${{ github.ref == 'refs/heads/formsflow-forms' }} | |
id: docker_build_latest | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64/v8 | |
tags: formsflow/forms-flow-forms:${{ env.VERSION }}, formsflow/forms-flow-forms:latest | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |