Skip to content

Commit b0b5c07

Browse files
committed
update environment variable handling in Docker workflow and add AirPlay name
1 parent 35aaa76 commit b0b5c07

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# Govee API Key - get from Govee Developer Portal
66
GOVEE_API_KEY=your_govee_api_key_here
77

8+
# AirPlay device name - set by GitHub Actions based on deployment target
9+
AIRPLAY_NAME=HomeSpeaker
10+
811
# Add other environment variables as needed
912
# NIGHTSCOUT_URL=your_nightscout_url_here
1013
# CERTIFICATE_PASSWORD=your_certificate_password_here

.github/workflows/docker-image.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
# Then a new version will be deployed on the self-hosted runner.
1313

1414
jobs:
15-
rpi4:
15+
Build-and-Deploy:
1616
runs-on: [self-hosted, "${{ matrix.runner}}" ]
1717
strategy:
1818
matrix:
@@ -23,7 +23,7 @@ jobs:
2323
airplay_name: "Upstairs HomeSpeaker"
2424

2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727

2828
- name: Renew Tailscale certificate
2929
run: |
@@ -33,6 +33,16 @@ jobs:
3333
sudo openssl pkcs12 -export -out certificate.pfx -inkey ${HOSTNAME}.boston-cloud.ts.net.key -in ${HOSTNAME}.boston-cloud.ts.net.crt -passout pass:
3434
sudo chown piuser. certificate.pfx
3535
36+
- name: Write environment variables to .env file
37+
env:
38+
GOVEE_API_KEY: ${{ secrets.GOVEE_API_KEY }}
39+
AIRPLAY_NAME: "${{ matrix.airplay_name }}"
40+
run: |
41+
cat > .env << EOF
42+
GOVEE_API_KEY=${GOVEE_API_KEY}
43+
AIRPLAY_NAME=${AIRPLAY_NAME}
44+
EOF
45+
3646
- name: Docker compose pull
3747
run: docker-compose pull
3848

@@ -43,8 +53,6 @@ jobs:
4353
env:
4454
COMPOSE_DOCKER_CLI_BUILD: 1
4555
DOCKER_BUILDKIT: 1
46-
GOVEE_API_KEY: ${{ secrets.GOVEE_API_KEY }}
47-
AIRPLAY_NAME: "${{ matrix.airplay_name }}"
4856
run: docker-compose up -d --build --remove-orphans
4957

5058
- name: Wait for services to be ready

0 commit comments

Comments
 (0)