Skip to content

Veracrypt CI

Veracrypt CI #134

name: Veracrypt CI
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 12 * * 1'
push:
branches: [ master, veracrypt-beta ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build-veracrypt:
runs-on: ubuntu-latest
steps:
- name: Checkout Build Repo
uses: actions/checkout@v2
with:
path: ./build
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Docker Repo
id: repo
run: echo "::set-output name=repo::dcflachs/veracrypt-gui"
- name: Set Main Tag
id: main_tag
shell: bash
run: |
if [[ "${{ steps.extract_branch.outputs.branch }}" == "master" ]]
then
echo "::set-output name=tag::latest"
else
echo "::set-output name=tag::beta"
fi
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./build/veracrypt
platforms: linux/amd64
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: |
${{ steps.repo.outputs.repo }}:${{ steps.main_tag.outputs.tag }}
${{ steps.repo.outputs.repo }}:nightly-${{ steps.date.outputs.date }}