-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.63 KB
/
main-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Main push
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}/${{ github.head_ref || github.ref_name || github.ref }}
cancel-in-progress: true
jobs:
first:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- run: 'echo "$BRANCH_NAME"'
# cache-cleanup:
# if: ${{ always() }}
# needs: test
# runs-on: ubuntu-latest
# permissions:
# # `actions:write` permission is required to delete caches
# # See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
# actions: write
# contents: read
# defaults:
# run:
# working-directory: backend
# steps:
# - name: Check out code
# uses: actions/checkout@v3
# - name: Cleanup
# run: |
# gh extension install actions/gh-actions-cache
# REPO=${{ github.repository }}
# BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
# ## Setting this to not fail the workflow while deleting cache keys.
# set +e
# echo "Deleting bundle caches..."
# gh actions-cache delete ${{ runner.os }}-gems-v3-${{ hashFiles('./backend/Gemfile.lock') }} -R $REPO -B $BRANCH --confirm
# echo "Deleting asset caches..."
# gh actions-cache delete ${{ runner.os }}-assets-cache-${{ hashFiles('./backend/app/assets/**', './backend/vendor/assets/**', '!.git') }} -R $REPO -B $BRANCH --confirm
# echo "Done"
# env:
# GH_TOKEN: ${{ secrets.TOKEN }}