Automated update #8806
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: Automated update | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/automated_update.yml' | |
schedule: | |
# Runs every hour | |
- cron: '0 */2 * * *' | |
env: | |
MONGODB_USERNAME: NecesseScraper | |
USER_SECRETS_ID: 6b77af8f-db3e-4b78-920a-e28ccc9a67bc | |
DOCKER_IMAGE: brammys/necesse-server-version-scraper | |
jobs: | |
update: | |
name: Check for updates | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Add MongoDb username | |
run: dotnet user-secrets set "Mongodb:Username" "${{ env.MONGODB_USERNAME}}" --id ${{ env.USER_SECRETS_ID}} | |
- name: Add MongoDb password | |
run: dotnet user-secrets set "Mongodb:Password" "${{ secrets.MONGODB_PASSWORD}}" --id ${{ env.USER_SECRETS_ID}} | |
- name: Pull image | |
run: docker pull ${{ env.DOCKER_IMAGE }} | |
- name: Run updater | |
run: docker run -v /home/runner/work/necesse-docker-server/necesse-docker-server/.github/workflows/publish_images.yml:/app/publish_images.yml -v ~/.microsoft/usersecrets/${{ env.USER_SECRETS_ID}}:/root/.microsoft/usersecrets/${{ env.USER_SECRETS_ID}} ${{ env.DOCKER_IMAGE }} | |
- name: Verify workflow changes | |
uses: tj-actions/verify-changed-files@v17 | |
id: workflow-changes | |
with: | |
files: | | |
.github/workflows/publish_images.yml | |
- name: Create Pull Request | |
if: steps.workflow-changes.outputs.files_changed == 'true' | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
delete-branch: true | |
reviewers: BrammyS | |
commit-message: Update version | |
branch: server-version-bump | |
title: "Bump: Necesse server version" | |
body: | | |
Automated version bump for Necesse server. |