mirror of
https://github.com/elgohr/Publish-Docker-Github-Action.git
synced 2026-03-12 18:07:12 -04:00
👷 Automate release process. Restructure workflows
This commit is contained in:
2
.github/workflows/automerge.yml
vendored
2
.github/workflows/automerge.yml
vendored
@@ -2,7 +2,7 @@ name: Dependabot auto-merge
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: [ master ]
|
||||
branches: [ main ]
|
||||
types: [ opened ]
|
||||
|
||||
permissions:
|
||||
|
||||
63
.github/workflows/release.yml
vendored
Normal file
63
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
name: Release
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build the Docker image
|
||||
run: docker build .
|
||||
|
||||
integration-test-github:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Publish to Registry
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
uses: elgohr/Publish-Docker-Github-Action@main
|
||||
with:
|
||||
name: docker.pkg.github.com/elgohr/publish-docker-github-action/publish-docker-github-action
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
|
||||
integration-test-dockerhub:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Publish to Registry
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
uses: elgohr/Publish-Docker-Github-Action@main
|
||||
with:
|
||||
name: lgohr/publish-docker-github-action
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
snapshot: true
|
||||
tag_names: true
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
needs:
|
||||
- test
|
||||
- integration-test-github
|
||||
- integration-test-dockerhub
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.PUBLISH_TOKEN }} # for pushing to protected branch
|
||||
- name: Publish new version
|
||||
run: |
|
||||
git config --global user.email "no_reply@gohr.digital"
|
||||
git config --global user.name "Release Bot"
|
||||
git tag -fa v4 -m "Update v4 tag"
|
||||
git push origin v4 --force
|
||||
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@@ -1,9 +0,0 @@
|
||||
name: Test
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build the Docker image
|
||||
run: docker build .
|
||||
19
.github/workflows/test_integration.yml
vendored
19
.github/workflows/test_integration.yml
vendored
@@ -1,19 +0,0 @@
|
||||
name: Integration Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
integration-test-dockerhub:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Publish to Registry
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
uses: elgohr/Publish-Docker-Github-Action@main
|
||||
with:
|
||||
name: lgohr/publish-docker-github-action
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
snapshot: true
|
||||
tag_names: true
|
||||
18
.github/workflows/test_integration_github.yml
vendored
18
.github/workflows/test_integration_github.yml
vendored
@@ -1,18 +0,0 @@
|
||||
name: Integration Test Github
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
integration-test-github:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Publish to Registry
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
uses: elgohr/Publish-Docker-Github-Action@main
|
||||
with:
|
||||
name: docker.pkg.github.com/elgohr/publish-docker-github-action/publish-docker-github-action
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
@@ -1,7 +1,5 @@
|
||||
# Publishes docker containers
|
||||
[](https://github.com/elgohr/Publish-Docker-Github-Action/actions)
|
||||
[](https://github.com/elgohr/Publish-Docker-Github-Action/actions)
|
||||
[](https://github.com/elgohr/Publish-Docker-Github-Action/actions)
|
||||
[](https://github.com/elgohr/Publish-Docker-Github-Action/actions/workflows/release.yml)
|
||||
|
||||
This Action for [Docker](https://www.docker.com/) uses the Git branch as the [Docker tag](https://docs.docker.com/engine/reference/commandline/tag/) for building and pushing the container.
|
||||
Hereby the master-branch is published as the latest-tag.
|
||||
|
||||
Reference in New Issue
Block a user