ci #24508
This file contains 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
# production environment -> main branch | |
# testing environment -> testing branch | |
name: ci | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
type: string | |
required: true | |
environment: | |
type: string | |
required: true | |
country: | |
type: string | |
required: true | |
concurrency: | |
# group: ${{ github.ref }} | |
group: ${{ inputs.country }}-${{ inputs.environment }} | |
cancel-in-progress: true | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
GOOGLE_TOKEN: ${{ secrets.GOOGLE_TOKEN }} | |
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
FAC_DB_ENVIRONMENT: ${{ inputs.environment }} | |
FAC_DB_COUNTRY: ${{ inputs.country }} | |
steps: | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libcurl4-openssl-dev | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.ref }} | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-renv@v2 | |
- run: Rscript code/update-views.R | |
- name: Send email | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: smtp.gmail.com | |
server_port: 465 | |
username: ${{ secrets.MAIL_USERNAME }} | |
password: ${{ secrets.MAIL_PASSWORD }} | |
subject: Facilitator Database ${{ inputs.country }} ${{ inputs.environment }} | |
to: ${{ env.EMAIL_TO }} | |
from: Youth Impact Data Traffic | |
body: | | |
Hello there! | |
GitHub Actions ran in ${{ inputs.country }}'s ${{ inputs.environment }} environment and gave the following message: | |
${{ env.MESSAGE }} | |
${{ env.RUN_URL }} | |
${{ env.FILE_URL }} | |
Take care, | |
Youth Impact Data Traffic |