-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (79 loc) · 2.21 KB
/
docker-publish.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Docker Image Publish
on:
push:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Build Docker images
run: docker compose -f ./docker-compose.prod.yml build
-
name: Show result
run: docker images
-
name: Save Docker images to tar
run: docker save -o image.tar steam-buddy_php:latest
-
name: Pack release files into zip
run: zip -r steam-buddy.zip docker-compose.prod.yml docker/production Makefile
-
name: Upload image artifact
uses: actions/upload-artifact@v2
with:
name: image.tar
path: image.tar
-
name: Upload release artifact
uses: actions/upload-artifact@v2
with:
name: steam-buddy.zip
path: steam-buddy.zip
release:
needs: [build]
runs-on: ubuntu-latest
steps:
-
name: Download all artifacts
uses: actions/download-artifact@v2
-
name: Display structure of downloaded files
run: ls -R
-
name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: Steam Buddy ${{ github.sha }}
draft: true
prerelease: false'
-
name: Upload image
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: image.tar/image.tar
asset_name: image.tar
asset_content_type: application/tar
-
name: Upload release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: steam-buddy.zip/steam-buddy.zip
asset_name: steam-buddy.zip
asset_content_type: application/zip