Compare commits
17 Commits
84d2035b9e
...
78fc7b1cb9
Author | SHA1 | Date |
---|---|---|
dm | 78fc7b1cb9 | |
dm | c904a6db9f | |
dm | 00cddc2f7d | |
dm | 4272f60528 | |
dm | 404975fcec | |
dm | 12927c17ea | |
dm | 083c0ca7f2 | |
dm | 81a505c772 | |
dm | f23e219240 | |
dm | c245bc0faa | |
dm | 4bc5a281a3 | |
dm | 7b5be2d07d | |
dm | 57b0c4d296 | |
dm | 1311b6c659 | |
dm | ed9d812dc6 | |
dm | ca2ea06778 | |
dm | 0700862857 |
|
@ -9,8 +9,6 @@ jobs:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
volumes:
|
volumes:
|
||||||
- ubuntu_hostedtoolcache:/opt/hostedtoolcache
|
- ubuntu_hostedtoolcache:/opt/hostedtoolcache
|
||||||
# env:
|
|
||||||
# RUNNER_TOOL_CACHE: /toolcache
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||||
|
@ -19,7 +17,13 @@ jobs:
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
- run: docker version
|
- run: docker version
|
||||||
- name: Check out repository code
|
- name: Checkout
|
||||||
env:
|
uses: https://gitea.com/actions/checkout@v4
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA1_TOKEN }}
|
with:
|
||||||
uses: git clone root@106.14.174.241:3000/root/simple-go-action.git .
|
fetch-depth: 0
|
||||||
|
- run: echo "🛠️ The Gitea Actions workflow is now ready to test your code on the runner."
|
||||||
|
- name: Build Docker image
|
||||||
|
run: docker build -t my-docker-image .
|
||||||
|
-name: Deploy to local Docker
|
||||||
|
run: docker run -d -p 8080:80 my-docker-image
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Use an official Go runtime as the base image
|
||||||
|
FROM golang:1.21
|
||||||
|
|
||||||
|
# Set the working directory inside the container
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the source code into the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build the Go application
|
||||||
|
RUN go build -o app
|
||||||
|
|
||||||
|
# Set the entry point for the container
|
||||||
|
ENTRYPOINT ["./app"]
|
2
main.go
2
main.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := readInputs()
|
username := readInputs()
|
||||||
fmt.Printf("username is %s\n", username)
|
fmt.Printf("username is %s\n", username)
|
||||||
|
@ -16,6 +17,7 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func readInputs() string {
|
func readInputs() string {
|
||||||
username := os.Getenv("INPUT_USERNAME")
|
username := os.Getenv("INPUT_USERNAME")
|
||||||
return username
|
return username
|
||||||
|
|
Loading…
Reference in New Issue