Skip to content

Commit

Permalink
Only release, don’t deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Feb 29, 2024
1 parent d1ad8f6 commit cfea53c
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/deploy.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,38 @@
name: Build and deploy app
name: Release

on:
push:
branches:
- churches
- paintings
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set variables
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "docker_image=ghcr.io/netwerk-digitaal-erfgoed/heritageflix-${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
echo "docker_image=ghcr.io/netwerk-digitaal-erfgoed/heritageflix" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.2.1
uses: docker/setup-buildx-action@v3

- name: Log in to Docker registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}

- name: Build and push image to registry
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ steps.vars.outputs.docker_image }}:${{ steps.vars.outputs.sha_short }}
${{ steps.vars.outputs.docker_image }}:latest
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Store DigitalOcean credentials
run: doctl kubernetes cluster kubeconfig save nde

- name: Update deployment
run: |
kubectl set image deployment/heritageflix-${GITHUB_REF_NAME} app=${{ steps.vars.outputs.docker_image }}:${{ steps.vars.outputs.sha_short }}

0 comments on commit cfea53c

Please sign in to comment.