master | delete return when getting default configuration #20
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: Deploy | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: bloock/managed-api | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Update repo description | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
repository: bloock/managed-api | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: [push] | |
steps: | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ needs.push.outputs.version }} | |
prerelease: ${{ contains(needs.push.outputs.version, 'beta') }} | |
generate_release_notes: true | |
deploy-dev: | |
name: Deploy DEV | |
runs-on: ubuntu-latest | |
needs: [push] | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.repo_api_token }} | |
repository: bloock/managed-services-actions | |
event-type: deploy_managed_api_dev | |
client-payload: '{"version": "${{ needs.push.outputs.version }}"}' | |
deploy-pro: | |
name: Deploy PRO | |
runs-on: ubuntu-latest | |
if: contains(needs.push.outputs.version, 'beta') == false | |
needs: [push] | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.repo_api_token }} | |
repository: bloock/managed-services-actions | |
event-type: deploy_managed_api_pro | |
client-payload: '{"version": "${{ needs.push.outputs.version }}"}' |