Skip to content

.github/workflows/backup_daily.yml #873

.github/workflows/backup_daily.yml

.github/workflows/backup_daily.yml #873

Workflow file for this run

# Copyright 2023 CS Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
on:
push:
branches:
- backup
schedule:
- cron: '0 0 * * *' # every day at midnight
jobs:
backup_daily:
runs-on: ubuntu-latest
environment: backup
strategy:
matrix:
repository: [infrastructure, processing-sentinel-1, processing-sentinel-2, processing-sentinel-3, production-common, reference-system-documentation, reference-system-software, rs-config, rs-issues, user-web-client, website]
steps:
- name: Extract date
shell: bash
run: echo "##[set-output name=date;]$(date +%Y%m%dT%H%M%S)"
id: extract_date
- name: Checkout
uses: actions/checkout@v2
with:
repository: COPRS/${{ matrix.repository }}
path: ${{ matrix.repository }}
fetch-depth: 0
token: ${{ secrets.TOKEN }}
- name: Backup
uses: peter-evans/s3-backup@v1
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
MIRROR_TARGET: ${{ secrets.MIRROR_TARGET }}/COPRS/${{ matrix.repository }}/DAILY_${{ steps.extract_date.outputs.date }}/
SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}
STORAGE_SERVICE_URL: ${{ secrets.STORAGE_SERVICE_URL }}
MIRROR_SOURCE: ${{ matrix.repository }}
with:
args: --overwrite --remove