Skip to content

Merge branch 'qa' into development #9

Merge branch 'qa' into development

Merge branch 'qa' into development #9

Workflow file for this run

name: deploy files
on: [push]
jobs:
deploy_website_container:
runs-on: ubuntu-latest
environment: development
name: Deploy the website container to an environment it can be picked up
steps:
- name: checkout
uses: actions/checkout@v4
- name: branch name
run: echo running on branch ${GITHUB_REF##*/}
- name: docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
chpl-website/app
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=raw,latest
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: build the image
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
outputs: type=docker,dest=/tmp/app.tar
- name: save the file
uses: actions/upload-artifact@v4
with:
name: app
path: /tmp/app.tar
- name: restore the file
uses: actions/download-artifact@v4
with:
name: app
path: distfiles
- name: copy file to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
source: distfiles/*
target: ${{ secrets.TARGET }}
- name: load the image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
script: |
echo ${{ secrets.PASSWORD }} | sudo -S docker load --input distfiles/app.tar
echo ${{ secrets.PASSWORD }} | sudo -S docker image ls -a