Fix another envvar and a ruby package dep problem #39
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
| on: [ push, pull_request, workflow_dispatch ] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| name: Publish Website | |
| steps: | |
| - name: Extract tag/branch variables | |
| shell: bash | |
| run: > | |
| echo "tag=$(echo ${GITHUB_REF#refs/tags/}|grep -v '/')" >> $GITHUB_OUTPUT | |
| echo "branch=$(echo ${GITHUB_REF#refs/heads/}|grep -v '/')" >> $GITHUB_OUTPUT | |
| id: extract | |
| - name: Write secret keys | |
| run: > | |
| echo "$FIREHOL_ORG_PUBLISH_SSH" > firehol_org_publish_key; | |
| chmod 600 firehol_org_publish_key; | |
| if [ -s firehol_org_publish_key ]; | |
| then | |
| eval "$(ssh-agent)"; | |
| ssh-add firehol_org_publish_key; | |
| echo "has_ssh_key=true" >> $GITHUB_OUTPUT | |
| echo "ssh_agent_pid=$SSH_AGENT_PID" >> $GITHUB_OUTPUT | |
| echo "ssh_auth_sock=$SSH_AUTH_SOCK" >> $GITHUB_OUTPUT | |
| fi; | |
| rm -f firehol_org_publish_key | |
| env: | |
| FIREHOL_ORG_PUBLISH_SSH: ${{secrets.FIREHOL_ORG_PUBLISH_SSH}} | |
| id: secret_keys | |
| - name: Skip branches which use a name reserved for use on the server | |
| if: >- | |
| ${{ steps.extract.outputs.branch == '' | |
| || steps.extract.outputs.branch == 'www' | |
| || steps.extract.outputs.branch == 'download' | |
| || steps.extract.outputs.branch == 'static' | |
| || steps.extract.outputs.branch == 'ssl' | |
| || steps.extract.outputs.branch == 'webalizer' | |
| || steps.extract.outputs.branch == 'tmp' }} | |
| run: > | |
| echo "Not publishing '${{steps.extract.outputs.branch}}'"; | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| id: check | |
| - uses: actions/checkout@v4 | |
| - run: ./.github/workflows/setup.sh | |
| - run: make | |
| - name: Deploy website ${{steps.extract.outputs.branch}} | |
| if: ${{ steps.secret_keys.outputs.has_ssh_key && ! steps.check.outputs.skip }} | |
| run: ./.github/workflows/deploy-website.sh ${{steps.extract.outputs.branch}} | |
| env: | |
| SSH_AGENT_PID: ${{ steps.secret_keys.outputs.ssh_agent_pid }} | |
| SSH_AUTH_SOCK: ${{ steps.secret_keys.outputs.ssh_auth_sock }} | |
| - name: Check deployment | |
| if: ${{ steps.secret_keys.outputs.has_ssh_key && ! steps.check.outputs.skip }} | |
| run: > | |
| sleep 300; | |
| curl -q -o- https://firehol.org/travis-website.log |