mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-26 02:04:52 +01:00
Add GitHub action to build a dev image tag
This commit is contained in:
parent
b211c808fc
commit
7f53771433
88
.github/workflows/ci-docker-dev.yml
vendored
Normal file
88
.github/workflows/ci-docker-dev.yml
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
name: ci-docker-dev
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- .github/workflows/ci-docker-dev.yml
|
||||
- app/**
|
||||
- bootstrap/**
|
||||
- config/**
|
||||
- database/**
|
||||
- docker/**
|
||||
- public/**
|
||||
- resources/**
|
||||
- routes/**
|
||||
- storage/**
|
||||
- tests/**
|
||||
- .dockerignore
|
||||
- .env.travis
|
||||
- artisan
|
||||
- composer.json
|
||||
- Dockerfile
|
||||
- phpunit.xml
|
||||
- server.php
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- .github/workflows/ci-docker-dev.yml
|
||||
- app/**
|
||||
- bootstrap/**
|
||||
- config/**
|
||||
- database/**
|
||||
- docker/**
|
||||
- public/**
|
||||
- resources/**
|
||||
- routes/**
|
||||
- storage/**
|
||||
- tests/**
|
||||
- .dockerignore
|
||||
- .env.travis
|
||||
- artisan
|
||||
- composer.json
|
||||
- Dockerfile
|
||||
- phpunit.xml
|
||||
- server.php
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: |
|
||||
(github.event_name == 'push' && github.repository == 'Bubka/2FAuth') ||
|
||||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'Bubka/2FAuth' && github.actor != 'dependabot[bot]')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
ref: ${{github.event.pull_request.head.ref}}
|
||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
|
||||
- uses: docker/login-action@v1
|
||||
with:
|
||||
username: 2fauth
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Set variables
|
||||
id: set_vars
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
run: |
|
||||
echo ::set-output name=commit::$(git rev-parse --short HEAD)
|
||||
echo ::set-output name=created::$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
echo ::set-output name=version::dev
|
||||
echo ::set-output name=platforms::linux/amd64,linux/386
|
||||
|
||||
- name: Build and push to docker Hub
|
||||
uses: docker/build-push-action@v2.6.1
|
||||
with:
|
||||
platforms: ${{ steps.set_vars.outputs.platforms }}
|
||||
build-args: |
|
||||
CREATED=${{ steps.set_vars.outputs.created }}
|
||||
COMMIT=${{ steps.set_vars.outputs.commit }}
|
||||
VERSION=${{ steps.set_version.outputs.version }}
|
||||
tags: |
|
||||
2fauth/2fauth:${{ steps.set_version.outputs.version }}
|
||||
push: true
|
4
.github/workflows/ci-docker-latest.yml
vendored
4
.github/workflows/ci-docker-latest.yml
vendored
@ -4,7 +4,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- .github/workflows/ci.yml
|
||||
- .github/workflows/ci-docker-latest.yml
|
||||
- app/**
|
||||
- bootstrap/**
|
||||
- config/**
|
||||
@ -26,7 +26,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- .github/workflows/ci.yml
|
||||
- .github/workflows/ci-docker-latest.yml
|
||||
- app/**
|
||||
- bootstrap/**
|
||||
- config/**
|
||||
|
Loading…
Reference in New Issue
Block a user