Skip to content

Commit

Permalink
Add: [Actions] switch to GitHub Container Repository
Browse files Browse the repository at this point in the history
Also switch to v2 of OpenTTD/actions, as this provides the needed
parameters to make this change.
  • Loading branch information
TrueBrain committed Sep 17, 2020
1 parent ef666d8 commit c0331ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:

steps:
- name: Deployment in progress
uses: openttd/actions/deployments-update@v1
uses: openttd/actions/deployments-update@v2
with:
github-token: ${{ secrets.DEPLOYMENT_TOKEN }}
state: in_progress
description: "Deployment of ${{ github.event.deployment.payload.version }} to ${{ github.event.deployment.environment }} started"

- name: Deploy on AWS
uses: openttd/actions/deploy-aws@v1
uses: openttd/actions/deploy-aws@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.AWS_REGION }}
Expand All @@ -26,7 +26,7 @@ jobs:

- if: success()
name: Deployment successful
uses: openttd/actions/deployments-update@v1
uses: openttd/actions/deployments-update@v2
with:
github-token: ${{ secrets.DEPLOYMENT_TOKEN }}
state: success
Expand All @@ -35,7 +35,7 @@ jobs:

- if: failure() || cancelled()
name: Deployment failed
uses: openttd/actions/deployments-update@v1
uses: openttd/actions/deployments-update@v2
with:
github-token: ${{ secrets.DEPLOYMENT_TOKEN }}
state: failure
20 changes: 11 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,43 @@ jobs:

- if: github.event_name == 'repository_dispatch'
name: Repository dispatch
uses: openttd/actions/checkout-dispatch@v1
uses: openttd/actions/checkout-dispatch@v2

- name: Checkout tags and submodules
uses: openttd/actions/checkout@v1
uses: openttd/actions/checkout@v2
with:
with-tags: true

- name: Set variables
id: vars
uses: openttd/actions/docker-vars@v1
uses: openttd/actions/docker-vars@v2
with:
docker-hub-username: ${{ secrets.DOCKER_USERNAME }}
registry-username: ${{ secrets.GHCR_USERNAME }}

- name: Build
uses: openttd/actions/docker-build@v1
uses: openttd/actions/docker-build@v2
with:
name: ${{ steps.vars.outputs.name }}
tag: ${{ steps.vars.outputs.tag }}
tags: ${{ steps.vars.outputs.tags }}
version: ${{ steps.vars.outputs.version }}
date: ${{ steps.vars.outputs.date }}
registry: ghcr.io

- if: steps.vars.outputs.dry-run == 'false'
name: Publish
id: publish
uses: openttd/actions/docker-publish@v1
uses: openttd/actions/docker-publish@v2
with:
docker-hub-username: ${{ secrets.DOCKER_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_PASSWORD }}
registry-username: ${{ secrets.GHCR_USERNAME }}
registry-password: ${{ secrets.GHCR_PASSWORD }}
registry: ghcr.io
name: ${{ steps.vars.outputs.name }}
tag: ${{ steps.vars.outputs.tag }}

- if: steps.vars.outputs.dry-run == 'false'
name: Trigger deployment
uses: openttd/actions/deployments-create@v1
uses: openttd/actions/deployments-create@v2
with:
ref: ${{ steps.vars.outputs.sha }}
environment: ${{ steps.vars.outputs.environment }}
Expand Down

0 comments on commit c0331ab

Please sign in to comment.