generated from cybnity/domain-vulnerability-mgt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automatic backup of project source codes to Bitbucket remote repo…
…sitory
- Loading branch information
1 parent
17d6d66
commit 65ea2c9
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Automated archiving of source codes repository to Bitbucket remote backup instance | ||
name: Project Assets Archiving | ||
run-name: ARCHIVING - Source codes backup refresh | ||
on: | ||
push: | ||
# execution when ... | ||
branches: | ||
- 'feature*' | ||
- 'main' | ||
- 'integration' | ||
- 'staging' | ||
delete: | ||
# execution when ... | ||
branches: | ||
- 'feature*' | ||
- 'main' | ||
- 'integration' | ||
- 'staging' | ||
|
||
# The archiging stage workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
mirror_repository_contents: | ||
name: Backup repository contents to Bitbucket | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Read reusable environment variables about current project | ||
if: ${{ env.TAG_VERSION == '' }} | ||
uses: FranzDiebold/github-env-vars-action@v2 | ||
|
||
- name: Checkout source codes from branch | ||
id: checkout_step | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.repository }} | ||
token: ${{ github.token }} | ||
ref: ${{ inputs.branch_name }} | ||
fetch-depth: 0 # <-- clone with complete history | ||
|
||
- name: "Push contents of $CI_REPOSITORY_NAME project to Bitbucket repository" | ||
uses: heussd/mirror-to-bitbucket-github-action@v2 | ||
with: | ||
username: ${{ secrets.BITBUCKET_USERNAME }} | ||
spacename: ${{ secrets.BITBUCKET_WORKSPACE_NAME }} | ||
repository: $CI_REPOSITORY_NAME | ||
password: ${{ secrets.BITBUCKET_APP_PASSWORD }} |