Setup Restic on GitHub Actions to use restic
.
This action installs Restic for use in actions by installing it on tool cache using AnimMouse/tool-cache.
This action is implemented as a composite action.
With this action, you can now manipulate your Restic repository like check or prune on GitHub Actions.
To use restic
, run this action before restic
.
- Paste Restic repository to
RESTIC_REPOSITORY
secret. - Paste Restic repository password to
RESTIC_PASSWORD
secret.
steps:
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
- run: restic check
env:
RESTIC_REPOSITORY: ${{ secrets.RESTIC_REPOSITORY }}
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
- Add
restic-repository
workflow dispatch input on your workflow. - Paste Restic repository password to
RESTIC_PASSWORD
secret.
on:
workflow_dispatch:
inputs:
restic-repository:
description: Restic repository
required: true
default: rest:http://host:8000
steps:
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
- run: restic check
env:
RESTIC_REPOSITORY: ${{ inputs.restic-repository }}
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
- Paste Restic repository to
RESTIC_REPOSITORY:
environment variable. - Paste Restic repository password to
RESTIC_PASSWORD
secret.
steps:
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
- run: restic check
env:
RESTIC_REPOSITORY: rest:http://host:8000
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
- Paste AWS access key ID to
AWS_ACCESS_KEY_ID
secret. - Paste AWS secret access key to
AWS_SECRET_ACCESS_KEY
secret.
steps:
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
- run: restic check
env:
RESTIC_REPOSITORY: ${{ secrets.RESTIC_REPOSITORY }}
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- Paste B2 account ID to
B2_ACCOUNT_ID
secret. - Paste B2 account key to
B2_ACCOUNT_KEY
secret.
steps:
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
- run: restic check
env:
RESTIC_REPOSITORY: ${{ secrets.RESTIC_REPOSITORY }}
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
B2_ACCOUNT_KEY: ${{ secrets.B2_ACCOUNT_KEY }}
For other environment variable based repositories, you can use other variables, just follow the S3 and B2 examples.
You can use AnimMouse/setup-rclone in order to use Rclone on Restic.
steps:
- name: Setup Rclone
uses: AnimMouse/setup-rclone@v1
with:
rclone_config: ${{ secrets.RCLONE_CONFIG }}
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
- run: restic check
env:
RESTIC_REPOSITORY: ${{ secrets.RESTIC_REPOSITORY }}
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
You can specify the version you want. By default, this action downloads the latest version if version is not specified.
steps:
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
with:
version: 0.14.0
This action automatically uses a GitHub token in order to authenticate with GitHub API and avoid rate limiting. You can also specify your own read-only fine-grained personal access token.
steps:
- name: Setup Restic
uses: AnimMouse/setup-restic@v1
with:
token: ${{ secrets.GH_PAT }}