-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (125 loc) · 3.66 KB
/
pre-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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Create pre-release
on:
push:
branches:
- "master"
jobs:
test:
name: jMeter tests
runs-on: ubuntu-latest
services:
megen:
image: php:8.0-apache
ports:
- 80:80
volumes:
- ${{ github.workspace }}:/var/www/html/
steps:
- uses: actions/checkout@v4
- name: Run JMeter Tests
uses: rbhadti94/[email protected]
with:
testFilePath: tests/all.jmx
outputReportsFolder: reports/
- uses: actions/upload-artifact@v4
with:
name: jmeter-test-results
path: reports/
pre-release:
name: GitHub pre-release
runs-on: ubuntu-latest
needs: test
steps:
- name: Wait for concurrent jobs
uses: softprops/turnstyle@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "beta"
prerelease: true
title: "Development Build"
beta-deploy:
name: Beta deploy
runs-on: ubuntu-latest
needs: test
steps:
- name: Get latest code
uses: actions/checkout@v4
- name: Wait for concurrent jobs
uses: softprops/turnstyle@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sync files
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME_BETA }}
password: ${{ secrets.FTP_PASSWORD_BETA }}
protocol: ftps
exclude: |
**/.git*
**/.git*/**
**/.github/**
.dockerignore
logo/raw-svg
logo/raw-svg/*
logo/megen.png
Dockerfile
tests
tests/*
LICENSE
README.md
stack.yml
docker-hub:
name: Docker Hub
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Wait for concurrent jobs
uses: softprops/turnstyle@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=lszeremeta/megen
VERSION=latest
TAGS="${DOCKER_IMAGE}:${VERSION}"
echo ::set-output name=tags::${TAGS}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Update repo description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}
repository: lszeremeta/megen