Apply #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Apply | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }} | |
jobs: | |
deploy: | |
runs-on: libvirt | |
container: ghcr.io/makeitworkcloud/terraform-runner:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Git as root | |
run: git config --global --add safe.directory '*' | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | |
- name: Copy SSH area | |
run: cp -r /root/.ssh /github/home/ | |
- name: Ansible | |
run: | | |
rm -rf ~/.ansible >/dev/null 2>&1 || echo | |
ansible-galaxy install -r requirements.yml | |
ansible-playbook site.yml -u ${{ secrets.SSH_USER }} -i "${{ secrets.SSH_HOST }}," | |
- name: Login to OpenShift | |
uses: redhat-actions/oc-login@v1 | |
continue-on-error: true | |
with: | |
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} | |
openshift_username: ${{ secrets.OPENSHIFT_USERNAME }} | |
openshift_password: ${{ secrets.OPENSHIFT_PASSWORD }} | |
insecure_skip_tls_verify: true | |
- name: Terraform apply | |
run: make apply |