add build and deploy actions
Some checks failed
Build access-web-migration / Build-And-Push (push) Failing after 38s
Some checks failed
Build access-web-migration / Build-And-Push (push) Failing after 38s
This commit is contained in:
28
.gitea/workflows/build.yaml
Normal file
28
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Build access-web-migration
|
||||
|
||||
on: [push]
|
||||
|
||||
env:
|
||||
CONTAINER_NAME: pun-app
|
||||
IMAGE_NAME: 'deltreey/pun-app'
|
||||
|
||||
jobs:
|
||||
Build-And-Push:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Login
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.area-51-x.com
|
||||
username: ${{secrets.DOCKER_USER}}
|
||||
password: ${{secrets.DOCKER_PASSWORD}}
|
||||
- uses: mr-smithers-excellent/docker-build-push@v6
|
||||
name: Build & push Docker image
|
||||
with:
|
||||
image: ${IMAGE_NAME}
|
||||
tags: latest, ${{gitea.ref_name}}, ${{gitea.run_id}}
|
||||
registry: gitea.area-51-x.com
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
28
.gitea/workflows/deploy.yaml
Normal file
28
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Deploy Pun App
|
||||
|
||||
env:
|
||||
CONTAINER_NAME: pun-app
|
||||
IMAGE_NAME: 'deltreey/pun-app'
|
||||
|
||||
on: release
|
||||
|
||||
jobs:
|
||||
Deploy:
|
||||
runs-on: full
|
||||
steps:
|
||||
- name: Configure SSH
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
echo "${{secrets.SSH_KEY}}" > ~/.ssh/repo.key
|
||||
chmod 600 ~/.ssh/repo.key
|
||||
cat >>~/.ssh/config <<END
|
||||
Host florida
|
||||
HostName 192.168.111.206
|
||||
User ${{secrets.SSH_USER}}
|
||||
IdentityFile ~/.ssh/repo.key
|
||||
StrictHostKeyChecking no
|
||||
END
|
||||
- name: Update Test Site
|
||||
env:
|
||||
RUN_ARGS: ""
|
||||
run: ssh florida "docker login -u ${{secrets.DOCKER_USER}} -p ${{secrets.DOCKER_PASSWORD}} gitea.area-51-x.com && docker container stop ${CONTAINER_NAME}; docker container rm ${CONTAINER_NAME}; docker pull gitea.area-51-x.com/${IMAGE_NAME}:latest && docker run -d ${RUN_ARGS}--name ${CONTAINER_NAME} gitea.area-51-x.com/${IMAGE_NAME}:latest; docker logout gitea.area-51-x.com"
|
||||
Reference in New Issue
Block a user