-
Notifications
You must be signed in to change notification settings - Fork 28
52 lines (50 loc) · 1.88 KB
/
release.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
name: Release
on:
push:
tags:
- "*.*.*"
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: false
- name: Get tag
id: tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
- name: Build Docker image
run: docker build -t thunderstore:latest -t thunderstore:release-${TAG} .
- name: Run pytest
run: |
DJANGO_IMAGE="thunderstore:release-${TAG}" docker-compose -f docker/docker-compose.pytest.yml up --exit-code-from django
docker-compose -f docker/docker-compose.pytest.yml down -f
- name: Tag image
env:
TAG: ${{ steps.tag.outputs.tag }}
run: |
docker tag thunderstore:latest thunderstore/thunderstore:release-${TAG}
docker tag thunderstore:latest ghcr.io/thunderstore-io/thunderstore:release-${TAG}
- name: Login to Docker Hub
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- name: Push image to Docker Hub
env:
TAG: ${{ steps.tag.outputs.tag }}
run: |
echo "Pushing thunderstore/thunderstore:release-${TAG}"
docker push thunderstore/thunderstore:release-${TAG}
- name: Login to GitHub Container Registry
env:
DOCKER_USERNAME: ${{ secrets.GHCR_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.GHCR_PAT }}
run: docker login ghcr.io -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- name: Push image to GitHub Container Registry
env:
TAG: ${{ steps.tag.outputs.tag }}
run: |
echo "Pushing ghcr.io/thunderstore-io/thunderstore:release-${TAG}"
docker push ghcr.io/thunderstore-io/thunderstore:release-${TAG}