-
-
Notifications
You must be signed in to change notification settings - Fork 153
87 lines (82 loc) · 2.28 KB
/
ci-docker-publish-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: ci-docker-publish-dev
on:
push:
branches:
- dev
paths:
- .github/workflows/ci-docker-publish-dev.yml
- app/**
- bootstrap/**
- config/**
- database/**
- docker/**
- public/**
- resources/**
- routes/**
- storage/**
- tests/**
- .dockerignore
- .env.travis
- artisan
- composer.json
- composer.lock
- Dockerfile
- phpunit.xml
pull_request:
branches:
- dev
paths:
- .github/workflows/ci-docker-publish-dev.yml
- app/**
- bootstrap/**
- config/**
- database/**
- docker/**
- public/**
- resources/**
- routes/**
- storage/**
- tests/**
- .dockerignore
- .env.travis
- artisan
- composer.json
- composer.lock
- Dockerfile
- phpunit.xml
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@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set variables
id: set_vars
env:
EVENT_NAME: ${{ github.event_name }}
run: |
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "created=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
echo "platforms=linux/amd64,linux/386" >> $GITHUB_OUTPUT
- name: Build and push to docker Hub
uses: docker/build-push-action@v6
with:
platforms: ${{ steps.set_vars.outputs.platforms }}
build-args: |
CREATED=${{ steps.set_vars.outputs.created }}
COMMIT=${{ steps.set_vars.outputs.commit }}
VERSION=dev
tags: |
2fauth/2fauth:dev
push: true