Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] feat(website): update awesome data #4

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- build-website
- build-website-command
workflow_dispatch:
inputs:
hash-commit:
description: "Hash commit of awesome-italia-opensource"
required: false
default: ""

# Permissions for terramform-init action
permissions:
Expand All @@ -22,12 +27,20 @@ jobs:
steps:
- name: Load ENV
run: |
if [ "${{ github.event.client_payload.slash_command.args.named.pr_sha }}" == "" ]; then
echo "COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV
else
echo "COMMIT_SHA=${{ github.event.client_payload.slash_command.args.named.pr_sha }}" >> $GITHUB_ENV
branch_name=feat/build-website-${{ github.event_name }}-${{ github.sha }}
commit_sha=${{ github.sha }}

if [ "${{ inputs.hash-commit }}" != "" ] ; then
branch_name=feat/build-website-awesome-${{ inputs.hash-commit }}
fi

if [ "${{ github.event.client_payload.slash_command.args.named.pr_sha }}" != "" ]; then
commit_sha=${{ github.event.client_payload.slash_command.args.named.pr_sha }}
fi

echo "commit_sha=${commit_sha}" >> $GITHUB_OUTPUT
echo "branch_name=${branch_name}" >> $GITHUB_OUTPUT

- name: Check out code
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -59,17 +72,25 @@ jobs:
AWS_TERRAFORM_STATE_BUCKET: ${{ secrets.AWS_TERRAFORM_STATE_BUCKET }}

- name: Build
id: build
timeout-minutes: 5
run: |
make setup-website VIRTUAL_ENV=false
make download
make build

if [[ "$(git status -s)" == "" ]] ; then
echo "has_changed=false" >> "$GITHUB_OUTPUT"
else
echo "has_changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Create Pull Request
if: ${{ steps.build.outputs.has_changed == 'true' }}
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.ACTION_WORKFLOWS }}
title: "fix(website): update awesome data"
title: "feat(website): update awesome data"
body: "Update awesome data from: ${{ github.event_name }}"
commit-message: "Update awesome data from: ${{ github.event_name }}"
author: "FabrizioCafolla <${{ secrets.ACTION_EMAIL }}>"
Expand Down
2 changes: 1 addition & 1 deletion website/database/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"hash": "2a2ab58",
"ref": "https://github.com/italia-opensource/awesome-italia-opensource.git?ref=2a2ab58",
"source": "https://github.com/italia-opensource/awesome-italia-opensource.git",
"date": "Sat Jun 1 23:06:52 UTC 2024"
"date": "Sun Jun 2 17:47:06 UTC 2024"
}
Loading