-
Notifications
You must be signed in to change notification settings - Fork 1k
34 lines (34 loc) · 1.1 KB
/
images-updater-core.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
name: Updater-Core image
env:
UPDATER_CORE_IMAGE: "ghcr.io/dependabot/dependabot-updater-core"
on:
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
push-updater-core-image:
name: Push dependabot-updater-core image to GHCR
runs-on: ubuntu-latest
if: github.repository == 'dependabot/dependabot-core'
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build dependabot-updater-core image
run: script/build common
- name: Log in to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push latest image
run: |
docker push "$UPDATER_CORE_IMAGE:latest"
- name: Push tagged image
if: contains(github.ref, 'refs/tags')
run: |
VERSION="$(grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" common/lib/dependabot.rb)"
docker tag "$UPDATER_CORE_IMAGE:latest" "$UPDATER_CORE_IMAGE:$VERSION"
docker push "$UPDATER_CORE_IMAGE:$VERSION"