v0.2.4 #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Container - Publish | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish-container: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
db_type: | |
- mongodb | |
- postgresql | |
- mariadb | |
- file | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up metadata | |
id: pkg_meta | |
run: | | |
echo "::set-output name=package_scope::@awesome-database-backup/awesome-${{ matrix.db_type }}-backup" | |
echo "::set-output name=package_path::apps/awesome-${{ matrix.db_type }}-backup" | |
echo "::set-output name=package_repository::weseek/awesome-${{ matrix.db_type }}-backup" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to docker.io registry | |
run: | |
echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | | |
docker login --username ${{ secrets. DOCKER_REGISTRY_USERNAME }} --password-stdin | |
- name: Retrieve information from package.json | |
uses: myrotvorets/[email protected] | |
id: package-json | |
- name: Set up Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ steps.pkg_meta.outputs.package_repository }} | |
tags: | | |
type=raw,value=latest | |
type=semver,value=v${{ steps.package-json.outputs.packageVersion }},pattern={{major}} | |
type=semver,value=v${{ steps.package-json.outputs.packageVersion }},pattern={{major}}.{{minor}} | |
type=semver,value=v${{ steps.package-json.outputs.packageVersion }},pattern={{major}}.{{minor}}.{{patch}} | |
- name: Build and push container | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
build-args: | | |
packageScope=${{ steps.pkg_meta.outputs.package_scope }} | |
packagePath=${{ steps.pkg_meta.outputs.package_path }} | |
dbType=${{ matrix.db_type }} | |
tags: ${{ steps.meta.outputs.tags }} | |
- name: Update Docker hub's description | |
uses: peter-evans/[email protected] | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
DOCKERHUB_REPOSITORY: ${{ steps.pkg_meta.outputs.package_repository }} | |
README_FILEPATH: ${{ steps.pkg_meta.outputs.package_path }}/README.md | |
slack-notification: | |
needs: publish-container | |
runs-on: ubuntu-latest | |
steps: | |
- name: Slack Notification | |
uses: weseek/ghaction-release-slack-notification@master | |
with: | |
channel: '#srv' | |
url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
created_tag: ${{ github.ref_name }} |