49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: Build and push bunkerized-nginx
|
|
|
|
on:
|
|
push:
|
|
branches: [dev, master]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set variables
|
|
run: |
|
|
VER=$(cat VERSION | tr -d '\n')
|
|
echo "VERSION=$VER" >> $GITHUB_ENV
|
|
|
|
- name: Setup QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Setup Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Build and push (dev)
|
|
uses: docker/build-push-action@v2
|
|
if: github.ref == 'refs/heads/dev'
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8
|
|
push: true
|
|
tags: bunkerity/bunkerized-nginx:dev
|
|
|
|
- name: Build and push (master)
|
|
uses: docker/build-push-action@v2
|
|
if: github.ref == 'refs/heads/master'
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8
|
|
push: true
|
|
tags: bunkerity/bunkerized-nginx:latest,bunkerity/bunkerized-nginx:${{ env.VERSION }}
|