Skip to content

Commit

Permalink
⚗️ Experiment getting tags from json #1770
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Sep 21, 2023
1 parent 97ad455 commit 895eb8b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 47 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/ghcr-cleanup_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,33 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Checkout internal 🛎️
id: checkout-internal
uses: actions/checkout@v3
with:
repository: 'equinor/energyvision-internal'
ref: main
token: ${{ secrets.PAT }}

- name: Get tags to keep from output.json
id: get-tags
run: |
TAGS=$(jq -r '[.web[], .studio[] | "*" + .] | join(", ")' latest-prod-tags.json)
echo "TAGS_TO_KEEP=$TAGS" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3

- name: Get token 🔑
id: get-token
uses: ./.github/workflows/get-auth-token/

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install node-fetch

- name: Make API request and get used tags
id: fetch_and_process
run: node '.github/workflows/ghcr_cleanup/cleanup.js'

# - name: Clean up Docker images
# uses: snok/container-retention-policy@v1
# with:
# token: ${{ secrets.NLUN_GITHUB_PAT }}
# keep-at-least: 5
# account-type: org
# org-name: Equinor
# image-names: energyvision/*
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/ghcr_cleanup/cleanup.js

This file was deleted.

0 comments on commit 895eb8b

Please sign in to comment.