mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-19 19:28:08 +02:00
Upgrade Github Actions
This commit is contained in:
parent
18e83e1f4a
commit
3239bc2231
110
.github/workflows/ci-docker-latest.yml
vendored
110
.github/workflows/ci-docker-latest.yml
vendored
@ -1,110 +0,0 @@
|
|||||||
name: ci-docker-latest
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- .github/workflows/ci-docker-latest.yml
|
|
||||||
- app/**
|
|
||||||
- bootstrap/**
|
|
||||||
- config/**
|
|
||||||
- database/**
|
|
||||||
- docker/**
|
|
||||||
- public/**
|
|
||||||
- resources/**
|
|
||||||
- routes/**
|
|
||||||
- storage/**
|
|
||||||
- tests/**
|
|
||||||
- .dockerignore
|
|
||||||
- .env.travis
|
|
||||||
- artisan
|
|
||||||
- composer.json
|
|
||||||
- composer.lock
|
|
||||||
- Dockerfile
|
|
||||||
- phpunit.xml
|
|
||||||
- server.php
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- .github/workflows/ci-docker-latest.yml
|
|
||||||
- app/**
|
|
||||||
- bootstrap/**
|
|
||||||
- config/**
|
|
||||||
- database/**
|
|
||||||
- docker/**
|
|
||||||
- public/**
|
|
||||||
- resources/**
|
|
||||||
- routes/**
|
|
||||||
- storage/**
|
|
||||||
- tests/**
|
|
||||||
- .dockerignore
|
|
||||||
- .env.travis
|
|
||||||
- artisan
|
|
||||||
- composer.json
|
|
||||||
- composer.lock
|
|
||||||
- Dockerfile
|
|
||||||
- phpunit.xml
|
|
||||||
- server.php
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
verify:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
DOCKER_BUILDKIT: "1"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.4
|
|
||||||
|
|
||||||
- name: Build test image
|
|
||||||
run: docker build --target test -t test-container .
|
|
||||||
|
|
||||||
- name: Run tests in test container
|
|
||||||
run: |
|
|
||||||
touch coverage.txt
|
|
||||||
docker run --rm \
|
|
||||||
test-container
|
|
||||||
|
|
||||||
- name: Build final image
|
|
||||||
run: docker build .
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: [verify]
|
|
||||||
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::latest
|
|
||||||
echo ::set-output name=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7
|
|
||||||
|
|
||||||
- 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_vars.outputs.version }}
|
|
||||||
tags: |
|
|
||||||
2fauth/2fauth:${{ steps.set_vars.outputs.version }}
|
|
||||||
push: true
|
|
@ -1,10 +1,10 @@
|
|||||||
name: ci-docker-dev
|
name: ci-docker-publish-dev
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/ci-docker-dev.yml
|
- .github/workflows/ci-docker-publish-dev.yml
|
||||||
- app/**
|
- app/**
|
||||||
- bootstrap/**
|
- bootstrap/**
|
||||||
- config/**
|
- config/**
|
||||||
@ -27,7 +27,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/ci-docker-dev.yml
|
- .github/workflows/ci-docker-publish-dev.yml
|
||||||
- app/**
|
- app/**
|
||||||
- bootstrap/**
|
- bootstrap/**
|
||||||
- config/**
|
- config/**
|
||||||
@ -54,15 +54,15 @@ jobs:
|
|||||||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'Bubka/2FAuth' && github.actor != 'dependabot[bot]')
|
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'Bubka/2FAuth' && github.actor != 'dependabot[bot]')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
- uses: docker/setup-qemu-action@v1
|
- uses: docker/setup-qemu-action@v2
|
||||||
- uses: docker/setup-buildx-action@v1
|
- uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- uses: docker/login-action@v1
|
- uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: 2fauth
|
username: 2fauth
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
@ -72,19 +72,18 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
EVENT_NAME: ${{ github.event_name }}
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
run: |
|
run: |
|
||||||
echo ::set-output name=commit::$(git rev-parse --short HEAD)
|
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
echo ::set-output name=created::$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
echo "created=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
|
||||||
echo ::set-output name=version::dev
|
echo "platforms=linux/amd64,linux/386" >> $GITHUB_OUTPUT
|
||||||
echo ::set-output name=platforms::linux/amd64,linux/386
|
|
||||||
|
|
||||||
- name: Build and push to docker Hub
|
- name: Build and push to docker Hub
|
||||||
uses: docker/build-push-action@v2.6.1
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
platforms: ${{ steps.set_vars.outputs.platforms }}
|
platforms: ${{ steps.set_vars.outputs.platforms }}
|
||||||
build-args: |
|
build-args: |
|
||||||
CREATED=${{ steps.set_vars.outputs.created }}
|
CREATED=${{ steps.set_vars.outputs.created }}
|
||||||
COMMIT=${{ steps.set_vars.outputs.commit }}
|
COMMIT=${{ steps.set_vars.outputs.commit }}
|
||||||
VERSION=${{ steps.set_vars.outputs.version }}
|
VERSION=dev
|
||||||
tags: |
|
tags: |
|
||||||
2fauth/2fauth:${{ steps.set_vars.outputs.version }}
|
2fauth/2fauth:dev
|
||||||
push: true
|
push: true
|
76
.github/workflows/ci-docker-publish-release.yml
vendored
Normal file
76
.github/workflows/ci-docker-publish-release.yml
vendored
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
name: ci-docker-publish-release
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
- uses: docker/setup-qemu-action@v2
|
||||||
|
- uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: 2fauth
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set tags
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
id: set_tags
|
||||||
|
with:
|
||||||
|
# context.ref: For workflows triggered by release, this is the release tag created.
|
||||||
|
# A release tag is fully-formed as refs/tags/<tag_name> so we remove the 10 first
|
||||||
|
# characters to drop the 'refs/tags/' part.
|
||||||
|
script: |
|
||||||
|
const tag = context.ref.substring(10)
|
||||||
|
const version = tag.replace('v', '')
|
||||||
|
core.setOutput('version', version)
|
||||||
|
|
||||||
|
- 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,linux/arm64,linux/arm/v6,linux/arm/v7" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Update Docker Hub Description
|
||||||
|
uses: peter-evans/dockerhub-description@v3
|
||||||
|
with:
|
||||||
|
username: 2fauth
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
repository: 2fauth/2fauth
|
||||||
|
short-description: A web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
|
||||||
|
readme-filepath: docker/README.md
|
||||||
|
|
||||||
|
- name: Build and push to docker Hub with version as unique tag
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
platforms: ${{ steps.set_vars.outputs.platforms }}
|
||||||
|
build-args: |
|
||||||
|
CREATED=${{ steps.set_vars.outputs.created }}
|
||||||
|
COMMIT=${{ steps.set_vars.outputs.commit }}
|
||||||
|
VERSION=${{ steps.set_tags.outputs.version }}
|
||||||
|
tags: |
|
||||||
|
2fauth/2fauth:${{ steps.set_tags.outputs.version }}
|
||||||
|
push: true
|
||||||
|
|
||||||
|
- name: Build and push to docker Hub with stable tag latest
|
||||||
|
# We do not want to publish a prerelease as the 'latest' image
|
||||||
|
if: ${{ github.event.release.prerelease == false }}
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
platforms: ${{ steps.set_vars.outputs.platforms }}
|
||||||
|
build-args: |
|
||||||
|
CREATED=${{ steps.set_vars.outputs.created }}
|
||||||
|
COMMIT=${{ steps.set_vars.outputs.commit }}
|
||||||
|
VERSION=latest
|
||||||
|
tags: |
|
||||||
|
2fauth/2fauth:latest
|
||||||
|
push: true
|
59
.github/workflows/ci-docker-release.yml
vendored
59
.github/workflows/ci-docker-release.yml
vendored
@ -1,59 +0,0 @@
|
|||||||
name: ci-docker-release
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.release.tag_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 version
|
|
||||||
uses: actions/github-script@v4
|
|
||||||
id: set_version
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const tag = context.ref.substring(10)
|
|
||||||
const version = tag.replace('v', '')
|
|
||||||
core.setOutput('version', version)
|
|
||||||
|
|
||||||
- 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=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7
|
|
||||||
|
|
||||||
- name: Update Docker Hub Description
|
|
||||||
uses: peter-evans/dockerhub-description@v2.4.3
|
|
||||||
with:
|
|
||||||
username: 2fauth
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
repository: 2fauth/2fauth
|
|
||||||
short-description: A web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
|
|
||||||
readme-filepath: docker/README.md
|
|
||||||
|
|
||||||
- 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
|
|
68
.github/workflows/ci-docker-test.yml
vendored
Normal file
68
.github/workflows/ci-docker-test.yml
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
name: ci-docker-test
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- .github/workflows/ci-docker-test.yml
|
||||||
|
- app/**
|
||||||
|
- bootstrap/**
|
||||||
|
- config/**
|
||||||
|
- database/**
|
||||||
|
- docker/**
|
||||||
|
- public/**
|
||||||
|
- resources/**
|
||||||
|
- routes/**
|
||||||
|
- storage/**
|
||||||
|
- tests/**
|
||||||
|
- .dockerignore
|
||||||
|
- .env.travis
|
||||||
|
- artisan
|
||||||
|
- composer.json
|
||||||
|
- composer.lock
|
||||||
|
- Dockerfile
|
||||||
|
- phpunit.xml
|
||||||
|
- server.php
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- .github/workflows/ci-docker-test.yml
|
||||||
|
- app/**
|
||||||
|
- bootstrap/**
|
||||||
|
- config/**
|
||||||
|
- database/**
|
||||||
|
- docker/**
|
||||||
|
- public/**
|
||||||
|
- resources/**
|
||||||
|
- routes/**
|
||||||
|
- storage/**
|
||||||
|
- tests/**
|
||||||
|
- .dockerignore
|
||||||
|
- .env.travis
|
||||||
|
- artisan
|
||||||
|
- composer.json
|
||||||
|
- composer.lock
|
||||||
|
- Dockerfile
|
||||||
|
- phpunit.xml
|
||||||
|
- server.php
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DOCKER_BUILDKIT: "1"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build test image
|
||||||
|
run: docker build --target test -t test-container .
|
||||||
|
|
||||||
|
- name: Run tests in test container
|
||||||
|
run: |
|
||||||
|
touch coverage.txt
|
||||||
|
docker run --rm \
|
||||||
|
test-container
|
||||||
|
|
||||||
|
- name: Build final image
|
||||||
|
run: docker build .
|
2
.github/workflows/update-docs.yml
vendored
2
.github/workflows/update-docs.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Pushes docker-compose
|
- name: Pushes docker-compose
|
||||||
uses: dmnemec/copy_file_to_another_repo_action@main
|
uses: dmnemec/copy_file_to_another_repo_action@main
|
||||||
|
Loading…
x
Reference in New Issue
Block a user