Check Google Drive Access #23
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
name: "New Check Google Drive Access" | |
on: | |
workflow_dispatch: | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
env: | |
REPO_OWNER: ${{ github.repository_owner}} | |
REPO_BRANCH: ${{ github.ref_name }} | |
SERVICE_ACCOUNT_KEY_JSON: ${{ secrets.SERVICE_ACCOUNT_KEY_JSON }} | |
GDRIVE_FOLDER: ${{ vars.GDRIVE_FOLDER }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v40 | |
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit. | |
- name: List all changed files | |
id: filter | |
run: | | |
echo "::set-output name=devcontainer::false" | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
echo "$file was changed" | |
if [[ $file = .devcontainer* ]]; then | |
echo "::set-output name=devcontainer::true" | |
fi | |
done | |
- uses: dorny/paths-filter@v2 | |
id: old-filter | |
with: | |
base: ${{ github.ref }} | |
ref: ${{ github.ref }} | |
filters: | | |
devcontainer: | |
- '.devcontainer/**' | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build dev container | |
if: steps.filter.outputs.devcontainer == 'true' | |
run: | | |
docker build --no-cache --tag ghcr.io/caciviclab/disclosure-backend-static:latest -f ./.devcontainer/Dockerfile . | |
docker push ghcr.io/caciviclab/disclosure-backend-static:latest | |
- name: Test pull from gdrive | |
if: steps.filter.outputs.devcontainer != 'true' | |
uses: ./.github | |
with: | |
entrypoint: python | |
args: test_pull_from_gdrive.py | |
- name: Archive pulled files | |
if: steps.filter.outputs.devcontainer != 'true' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: redacted-netfile-files | |
path: .local/downloads | |