-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (42 loc) · 1.63 KB
/
push_deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deploy push
on: push
permissions:
contents: read
jobs:
secrets-check:
name: Check if some secrets are set
runs-on: ubuntu-latest
outputs:
push_ftp_url_available: ${{ steps.push_ftp_check.outputs.push_ftp_url_available }}
steps:
- name: Check if PUSH_FTP_URL is set
id: push_ftp_check
run: |
echo "::set-output name=push_ftp_url_available::${{ secrets.PUSH_FTP_URL != '' }}"
deploy-image:
needs: [secrets-check]
runs-on: [self-hosted, kstest]
if: needs.secrets-check.outputs.push_ftp_url_available == 'true'
steps:
- name: Checkout change
uses: actions/checkout@v3
with:
submodules: recursive
path: anabot
- name: start container
run:
podman run --name anabot --rm -it --detach -v $GITHUB_WORKSPACE:/root/workspace:rw,Z quay.io/centos/centos:stream9 sleep 300
- name: install dependencies needed for build and push
run: |
podman exec -it anabot dnf -y install tar gzip lftp
- name: build image
run: |
podman exec -it -w /root/workspace/anabot -e BEAKER_HUB_HOSTNAME="${{ secrets.BEAKER_HUB_HOSTNAME }}" anabot ./make_updates.sh ../anabot-${{ github.ref_name }}-${{ github.ref_name }}.tar.gz
- name: publish image
run: |
podman exec -it -w /root/workspace anabot lftp -e "put anabot-${{ github.ref_name }}-${{ github.ref_name }}.tar.gz; exit" ${{ secrets.PUSH_FTP_URL }} &> /dev/null
- name: cleanup container
if: always()
run: |
podman kill anabot
podman image rm --force quay.io/centos/centos:stream9